From patchwork Sun Nov 5 10:02:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 834312 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-465955-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="OqzP7Lec"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yVB8K2G8rz9t34 for ; Sun, 5 Nov 2017 21:02:54 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:cc:message-id:date:mime-version:content-type; q=dns; s=default; b=xq0NgIs7iinBOJeZkRQbGHrpG0UjbOOOUBvKlmzvvs0ut5f7vJ VEoHFotmxRHO5HAJbkcbOadxFJVM06XQwFO2/HG/UgOqIPCHye3cKu9etpJYnHRy 6ZecfhXRHR/CYBb6Gw0OXaRgYNDO+4a20YxbR0hNyfY+Q2KP7V7edS7W8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:cc:message-id:date:mime-version:content-type; s= default; bh=s+4WmdKzexmKZ6Q6om5wQ9TrYZY=; b=OqzP7LecqVRXbzxKz8Qa Djrq/HIOavQidgMZpdYEjL8SWc2w4eYVfSCmSeyw2pl9ilpT1UGKPnS+bQfUG+AT u9UR6gqt8ntRHgZgRVeHAWftAl8KydN/dLiF3P4BXVPSB1cK9ScjX5d4ta9XaM7u iy+CTytix7UwhT6iBPQ/4go= Received: (qmail 100373 invoked by alias); 5 Nov 2017 10:02:47 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 100335 invoked by uid 89); 5 Nov 2017 10:02:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy=beg, H*Ad:U*kcc, sk:sanitiz X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 05 Nov 2017 10:02:40 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-MBX-04.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1eBHlF-00000H-7Z from Tom_deVries@mentor.com ; Sun, 05 Nov 2017 02:02:37 -0800 Received: from [172.30.72.166] (137.202.0.87) by SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Sun, 5 Nov 2017 10:02:33 +0000 From: Tom de Vries Subject: [PATCH 1/7] [libsanitizer, committed] Remove semicolon after do {} while (0) in macro body To: GCC Patches CC: Kostya Serebryany Message-ID: Date: Sun, 5 Nov 2017 11:02:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) Hi, this removes a semicolon after "do {} while (0)" in several macro bodies in libsanitizer. This allows the macros to be used in if-then-elses without curly braces. Committed as obvious. Thanks, - Tom 2017-11-02 Tom de Vries PR other/82784 * asan/asan_poisoning.cc (CHECK_SMALL_REGION): Remove semicolon after "do {} while (0)". * lsan/lsan_common.cc (LOG_POINTERS, LOG_THREADS): Same. Signed-off-by: Tom de Vries --- libsanitizer/asan/asan_poisoning.cc | 2 +- libsanitizer/lsan/lsan_common.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libsanitizer/asan/asan_poisoning.cc b/libsanitizer/asan/asan_poisoning.cc index 15cd8ea..1343dfb 100644 --- a/libsanitizer/asan/asan_poisoning.cc +++ b/libsanitizer/asan/asan_poisoning.cc @@ -215,7 +215,7 @@ uptr __asan_region_is_poisoned(uptr beg, uptr size) { uptr __bad = __asan_region_is_poisoned(__p, __size); \ __asan_report_error(pc, bp, sp, __bad, isWrite, __size, 0);\ } \ - } while (false); \ + } while (false) extern "C" SANITIZER_INTERFACE_ATTRIBUTE diff --git a/libsanitizer/lsan/lsan_common.cc b/libsanitizer/lsan/lsan_common.cc index a3274d5..4afce9d 100644 --- a/libsanitizer/lsan/lsan_common.cc +++ b/libsanitizer/lsan/lsan_common.cc @@ -55,12 +55,12 @@ void RegisterLsanFlags(FlagParser *parser, Flags *f) { #define LOG_POINTERS(...) \ do { \ if (flags()->log_pointers) Report(__VA_ARGS__); \ - } while (0); + } while (0) #define LOG_THREADS(...) \ do { \ if (flags()->log_threads) Report(__VA_ARGS__); \ - } while (0); + } while (0) ALIGNED(64) static char suppression_placeholder[sizeof(SuppressionContext)]; static SuppressionContext *suppression_ctx = nullptr; From patchwork Sun Nov 5 10:04:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 834315 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-465956-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="tiUr+5ys"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yVBBS4zhqz9t34 for ; Sun, 5 Nov 2017 21:04:48 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:cc:message-id:date:mime-version:content-type; q=dns; s=default; b=BCYKVhioAcP3ZZi0CMMPYa12JLUgl+oLA5noPVj5SDCHsaREnf r4Og2Tp3mxtj1teHsoonnhdMqh+kQh/GeMhhXamkGw7P4JfY28S/hz3NzhytLcNO pNKtMoc4oVrim7bZolKBhFwqroMtSb5T0/V1ZfrIhxr1GHtFmHuv4ZFeY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:cc:message-id:date:mime-version:content-type; s= default; bh=2Q34rfz51FVHmOCgEOlR0JDBZ74=; b=tiUr+5ysoLtivDDLiYXM 3Edbpdp5draSHbZqsvHa9O7DY9RXBby9p3V/3foM0tcAUqWYhc+joZbe96JKzBkO KgCYHJjakWwiVF9m7yJokryuDUoasX0k41jCwj29s39H745xzf3veR7kycRKrPkw kAL7Hoidw7Z3LPNYPEVzhro= Received: (qmail 102548 invoked by alias); 5 Nov 2017 10:04:41 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 102539 invoked by uid 89); 5 Nov 2017 10:04:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy=Hx-languages-length:966 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 05 Nov 2017 10:04:39 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-MBX-04.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1eBHnB-0000Is-Is from Tom_deVries@mentor.com ; Sun, 05 Nov 2017 02:04:37 -0800 Received: from [172.30.72.166] (137.202.0.87) by SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Sun, 5 Nov 2017 10:04:34 +0000 From: Tom de Vries Subject: [PATCH 2/7] [libquadmath, committed] Remove semicolon after do {} while (0) in MPN_MUL_N_RECURSE To: GCC Patches CC: Jakub Jelinek Message-ID: <93a42f29-2019-7fb9-2ef6-486c3fcdc4c5@mentor.com> Date: Sun, 5 Nov 2017 11:04:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) Hi, this patch removes a semicolon after "do {} while (0)" in MPN_MUL_N_RECURSE. This allows the macro to be used in if-then-elses without curly braces. Committed as obvious. Thanks, - Tom 2017-11-02 Tom de Vries PR other/82784 * printf/gmp-impl.h (MPN_MUL_N_RECURSE): Remove semicolon after "do {} while (0)". Signed-off-by: Tom de Vries --- libquadmath/printf/gmp-impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libquadmath/printf/gmp-impl.h b/libquadmath/printf/gmp-impl.h index 969574c..94d88ef 100644 --- a/libquadmath/printf/gmp-impl.h +++ b/libquadmath/printf/gmp-impl.h @@ -91,7 +91,7 @@ typedef unsigned int UHWtype; impn_mul_n_basecase (prodp, up, vp, size); \ else \ impn_mul_n (prodp, up, vp, size, tspace); \ - } while (0); + } while (0) #define __MPN(x) __quadmath_mpn_##x From patchwork Sun Nov 5 10:04:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 834316 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-465957-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="ONznoWmn"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yVBBk443Sz9t34 for ; Sun, 5 Nov 2017 21:05:02 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:cc:message-id:date:mime-version:content-type; q=dns; s=default; b=WQYo57ChFvm5S/uzmwZUhVgtA1T2Y4joWWJFWnwCg9dGRI3WoF IYjrt3horLJVclxY/ATW6YZ/8fWkdxlNtF/iBPnB7zQ/+ejrci7n6Z+d6KmqwrNc V1H/9igE3ySHmYRDPV0d3dgKn2zq2gfXMwpE3ryaIbsTww3cXQl1CICBU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:cc:message-id:date:mime-version:content-type; s= default; bh=aQFob0F7Ciy9oaI/csLk1Gx/Dh0=; b=ONznoWmnNxlcTP0emfcT q1ipPeG7n8qgR/w9//Mg6294DnFIUk72mwLu+M9IS7B4DR2oa4rZTExzzSB+nGt9 pMbsFqmfhT28lxRrEkDlF2u6K5GBgc7nG7xC0/Tq+FZthYDmhBhNcTJlVLvEN5gO FF1sauvPeGEZOaJA/gaQEAU= Received: (qmail 103966 invoked by alias); 5 Nov 2017 10:04:54 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 103923 invoked by uid 89); 5 Nov 2017 10:04:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy=Pretty, SCoPs, scops, Hx-languages-length:1022 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 05 Nov 2017 10:04:52 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-MBX-04.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1eBHnO-0000Jo-9v from Tom_deVries@mentor.com ; Sun, 05 Nov 2017 02:04:50 -0800 Received: from [172.30.72.166] (137.202.0.87) by SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Sun, 5 Nov 2017 10:04:46 +0000 From: Tom de Vries Subject: [PATCH 3/7] [graphite, committed] Remove semicolon after do {} while (0) in DEBUG_PRINT To: GCC Patches CC: Sebastian Pop Message-ID: <87c9e5e4-f250-a3a4-9e81-a64c223c42fe@mentor.com> Date: Sun, 5 Nov 2017 11:04:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) Hi, this patch removes a semicolon after "do {} while (0)" in DEBUG_PRINT. This allows the macro to be used in if-then-elses without curly braces. Committed as obvious. Thanks, - Tom 2017-11-02 Tom de Vries PR other/82784 * graphite-scop-detection.c (DEBUG_PRINT): Remove semicolon after "do {} while (0)". Signed-off-by: Tom de Vries --- gcc/graphite-scop-detection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c index c236556..dd273a4 100644 --- a/gcc/graphite-scop-detection.c +++ b/gcc/graphite-scop-detection.c @@ -81,7 +81,7 @@ public: #define DEBUG_PRINT(args) do \ { \ if (dump_file && (dump_flags & TDF_DETAILS)) { args; } \ - } while (0); + } while (0) /* Pretty print to FILE all the SCoPs in DOT format and mark them with different colors. If there are not enough colors, paint the From patchwork Sun Nov 5 10:05:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 834317 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-465958-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="kx+qgIg/"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yVBC50lsPz9t34 for ; Sun, 5 Nov 2017 21:05:20 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:cc:message-id:date:mime-version:content-type; q=dns; s=default; b=VxswIu8ZxkJPeFayBwgor5to5qObTC/92BVYZD6rsxMk+hpTDa TyGbjBkZwylFGtMbR0Xj9dm5QzsrG1mYcyxGcm6uiTz9hj4c7Nb5V8kH/frcz73w p3wJudgc4CN5rJL8u3WvFjEAZ2U+DylJZwudd+M/FgbbIfudGUTRyN3Hs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:cc:message-id:date:mime-version:content-type; s= default; bh=PmlAjRkLk/YHYYnVqy7uV/kOpsU=; b=kx+qgIg/dZhCioSS2E1S 1D4/Wr5rI7hLxBu1Uk7fRITNKXFq8rEa9Bf2xsD/83N392O0YQ49RHoH4e2KGRRC fJDiAzMrc3VYTlkQXL5E4KjA7d66bucQYPGmYVhnrAb+mdzX+LlAmMUjMu8P0edc PbOFNXV7k/yoPfcxDFB9+84= Received: (qmail 105430 invoked by alias); 5 Nov 2017 10:05:12 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 105405 invoked by uid 89); 5 Nov 2017 10:05:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy=specialist, 7747 X-Spam-User: qpsmtpd, 2 recipients X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 05 Nov 2017 10:05:09 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-MBX-04.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1eBHnf-0000Kt-7U from Tom_deVries@mentor.com ; Sun, 05 Nov 2017 02:05:07 -0800 Received: from [172.30.72.166] (137.202.0.87) by SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Sun, 5 Nov 2017 10:05:03 +0000 From: Tom de Vries Subject: [PATCH 4/7] [fortran, committed] Remove semicolon after do {} while (0) in match macros To: GCC Patches , Fortran List CC: Jakub Jelinek , Message-ID: Date: Sun, 5 Nov 2017 11:05:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) Hi, this patch removes a semicolon after "do {} while (0)" in match macros. This allows the macros to be used in if-then-elses without curly braces. Thanks, - Tom 2017-11-02 Tom de Vries PR other/82784 * parse.c (match, matcha, matchs, matcho, matchds, matchdo): Remove semicolon after "do {} while (0)". Signed-off-by: Tom de Vries --- gcc/fortran/parse.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index e4deff9..d025c91 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -132,7 +132,7 @@ use_modules (void) return st; \ else \ undo_new_statement (); \ - } while (0); + } while (0) /* This is a specialist version of decode_statement that is used @@ -606,7 +606,7 @@ decode_statement (void) return st; \ else \ undo_new_statement (); \ - } while (0); + } while (0) static gfc_statement decode_oacc_directive (void) @@ -728,7 +728,7 @@ decode_oacc_directive (void) } \ else \ undo_new_statement (); \ - } while (0); + } while (0) /* Like match, but don't match anything if not -fopenmp and if spec_only, goto do_spec_only without actually matching. */ @@ -746,7 +746,7 @@ decode_oacc_directive (void) } \ else \ undo_new_statement (); \ - } while (0); + } while (0) /* Like match, but set a flag simd_matched if keyword matched. */ #define matchds(keyword, subr, st) \ @@ -759,7 +759,7 @@ decode_oacc_directive (void) } \ else \ undo_new_statement (); \ - } while (0); + } while (0) /* Like match, but don't match anything if not -fopenmp. */ #define matchdo(keyword, subr, st) \ @@ -774,7 +774,7 @@ decode_oacc_directive (void) } \ else \ undo_new_statement (); \ - } while (0); + } while (0) static gfc_statement decode_omp_directive (void) From patchwork Sun Nov 5 10:05:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 834318 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-465959-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="JMsxcJoH"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yVBCg5Xtyz9t34 for ; Sun, 5 Nov 2017 21:05:51 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:cc:message-id:date:mime-version:content-type; q=dns; s=default; b=DNlf/ovCz+thfQVF+voo0NneTW5sFGk/FNyXiElrfuG+vofMoQ UCcs7oV+geJWAaomwRCYBW2tEVR9uvht2sOQg8ASGGIPxMeJaJrAhYvomwq0TbnO 0kOj+BVKNjHTK4DXVu4FHSlQKm+NPKb9FSFjRSQa7LOVhjfk2Sl9XWoLo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:cc:message-id:date:mime-version:content-type; s= default; bh=pmhOoRc3c5wAtzAus5j1FxBy6GA=; b=JMsxcJoH8KUcK5qH1AGY Nw9PZ9iFUlqYQj4yTeSyu72Mq7low3dCrXbMlBkyCqfv0RgUdvN43uIkCSc/7aoF c3rO6iufRhci93BoMssYN75ZkpXgCod5jzWYyzTRYhWo8cGHAyR7t62Zs1HEF1XR zBxGx9EWevXLcCzCBpi9Ncw= Received: (qmail 107462 invoked by alias); 5 Nov 2017 10:05:42 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 107453 invoked by uid 89); 5 Nov 2017 10:05:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy=H*Ad:D*mips.com X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 05 Nov 2017 10:05:41 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-MBX-04.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1eBHoA-0000Ns-Sd from Tom_deVries@mentor.com ; Sun, 05 Nov 2017 02:05:38 -0800 Received: from [172.30.72.166] (137.202.0.87) by SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Sun, 5 Nov 2017 10:05:35 +0000 From: Tom de Vries Subject: [PATCH 5/7][committed] Remove semicolon after ASM_OUTPUT_BEFORE_CASE_LABEL macro body To: GCC Patches CC: Claudiu Zissulescu , Andreas Schwab , Matthew Fortune , Nick Clifton Message-ID: Date: Sun, 5 Nov 2017 11:05:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) Hi, this patch removes a semicolon after ASM_OUTPUT_BEFORE_CASE_LABEL macro bodies. This allows the macro to be used in if-then-elses without curly braces. Bootstrapped and reg-tested on x86_64. Committed as obvious. Thanks, - Tom 2017-11-02 Tom de Vries PR other/82784 * config/elfos.h (ASM_OUTPUT_BEFORE_CASE_LABEL): Remove semicolon after macro body. (ASM_OUTPUT_CASE_LABEL): Add semicolon after ASM_OUTPUT_BEFORE_CASE_LABEL call. * config/arc/arc.h (ASM_OUTPUT_BEFORE_CASE_LABEL): Remove semicolon after macro body. * config/m68k/m68kelf.h (ASM_OUTPUT_BEFORE_CASE_LABEL): Same. * config/mips/mips.h (ASM_OUTPUT_BEFORE_CASE_LABEL): Same. * config/v850/v850.h (ASM_OUTPUT_BEFORE_CASE_LABEL): Same. Signed-off-by: Tom de Vries --- gcc/config/arc/arc.h | 2 +- gcc/config/elfos.h | 6 +++--- gcc/config/m68k/m68kelf.h | 2 +- gcc/config/mips/mips.h | 2 +- gcc/config/v850/v850.h | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h index 1d9063a..ec28d61 100644 --- a/gcc/config/arc/arc.h +++ b/gcc/config/arc/arc.h @@ -1405,7 +1405,7 @@ do { \ (exact_log2 (GET_MODE_SIZE (GET_MODE (PATTERN (VEC_INSN))))) #undef ASM_OUTPUT_BEFORE_CASE_LABEL #define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE, PREFIX, NUM, TABLE) \ - ASM_OUTPUT_ALIGN ((FILE), ADDR_VEC_ALIGN (TABLE)); + ASM_OUTPUT_ALIGN ((FILE), ADDR_VEC_ALIGN (TABLE)) #define INSN_LENGTH_ALIGNMENT(INSN) \ ((JUMP_TABLE_DATA_P (INSN) \ diff --git a/gcc/config/elfos.h b/gcc/config/elfos.h index 47a0711..0f79de7 100644 --- a/gcc/config/elfos.h +++ b/gcc/config/elfos.h @@ -135,15 +135,15 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #ifndef ASM_OUTPUT_BEFORE_CASE_LABEL #define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE, PREFIX, NUM, TABLE) \ - ASM_OUTPUT_ALIGN ((FILE), 2); + ASM_OUTPUT_ALIGN ((FILE), 2) #endif #undef ASM_OUTPUT_CASE_LABEL #define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, JUMPTABLE) \ do \ { \ - ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \ - (*targetm.asm_out.internal_label) (FILE, PREFIX, NUM); \ + ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE); \ + (*targetm.asm_out.internal_label) (FILE, PREFIX, NUM); \ } \ while (0) diff --git a/gcc/config/m68k/m68kelf.h b/gcc/config/m68k/m68kelf.h index 159223f..408eec8 100644 --- a/gcc/config/m68k/m68kelf.h +++ b/gcc/config/m68k/m68kelf.h @@ -133,7 +133,7 @@ do { \ table. */ #undef ASM_OUTPUT_BEFORE_CASE_LABEL #define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \ - fprintf ((FILE), "%s&%d\n", SWBEG_ASM_OP, XVECLEN (PATTERN (TABLE), 1)); + fprintf ((FILE), "%s&%d\n", SWBEG_ASM_OP, XVECLEN (PATTERN (TABLE), 1)) /* end of stuff from m68kv4.h */ #undef ENDFILE_SPEC diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index f5c28bf..d7f86b6 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -2953,7 +2953,7 @@ do { \ if (JUMP_TABLES_IN_TEXT_SECTION) \ mips_set_text_contents_type (STREAM, "__jump_", NUM, FALSE); \ } \ - while (0); + while (0) /* Reset text marking to code after an inline jump table. Like with the beginning of a jump table use the label number to keep symbols diff --git a/gcc/config/v850/v850.h b/gcc/config/v850/v850.h index 5eb2e88..54dcc09 100644 --- a/gcc/config/v850/v850.h +++ b/gcc/config/v850/v850.h @@ -743,7 +743,7 @@ typedef enum #undef ASM_OUTPUT_BEFORE_CASE_LABEL #define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \ - ASM_OUTPUT_ALIGN ((FILE), (TARGET_BIG_SWITCH ? 2 : 1)); + ASM_OUTPUT_ALIGN ((FILE), (TARGET_BIG_SWITCH ? 2 : 1)) #define WORD_REGISTER_OPERATIONS 1 From patchwork Sun Nov 5 10:06:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 834319 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-465960-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="UnntSaIk"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yVBDq0FF7z9t34 for ; Sun, 5 Nov 2017 21:06:50 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:cc:message-id:date:mime-version:content-type; q=dns; s=default; b=TrwPALbNaVbzZINtCP9GycCwgsbx+IvNzSq3zOCpHTzARv8AXC 1uY4K2wQVypnRreQXlpcUNJTjePZwgsKBi9lvdvj5z9LhuLo+mVXc8shgRocohyh LYJ9+jASOZ+6yldfB2VoNOoVskH7U83/Mq4/xmJj3KkUFn58EtQxSUNT8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:cc:message-id:date:mime-version:content-type; s= default; bh=R9wo/H9OSwxG+PWwRLGotYB1oJM=; b=UnntSaIkUwopyjVYk17H M7GJr+Zj9u97HLWUqDXTENx1LrPUNMx8ijvTjbjNmghhsOvDhCfYGdKNjLQEjuR9 JDhe6HbJeK8O/LxNlQE5TKZSElrrd3rw05kMJXNOspZNX9UwSUprP9A1H/BtVzLP CdPN+c57UufaOsP0BpdEiPk= Received: (qmail 114197 invoked by alias); 5 Nov 2017 10:06:40 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 114185 invoked by uid 89); 5 Nov 2017 10:06:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy=Hx-languages-length:845 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 05 Nov 2017 10:06:38 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-MBX-04.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1eBHp7-0000Su-8d from Tom_deVries@mentor.com ; Sun, 05 Nov 2017 02:06:37 -0800 Received: from [172.30.72.166] (137.202.0.87) by SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Sun, 5 Nov 2017 10:06:33 +0000 From: Tom de Vries Subject: [PATCH 6/7] [libcpp, committed] Remove semicolon after do {} while (0) in BUF_APPEND To: GCC Patches CC: David Malcolm Message-ID: Date: Sun, 5 Nov 2017 11:06:33 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) Hi, this patch removes a semicolon after "do {} while (0)" in BUF_APPEND. This allows the macro to be used in if-then-elses without curly braces. Committed as obvious. Thanks, - Tom 2017-11-02 Tom de Vries PR other/82784 * lex.c (BUF_APPEND): Remove semicolon after "do {} while (0)". Signed-off-by: Tom de Vries --- libcpp/lex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcpp/lex.c b/libcpp/lex.c index 40ff801..9164a07 100644 --- a/libcpp/lex.c +++ b/libcpp/lex.c @@ -1647,7 +1647,7 @@ lex_raw_string (cpp_reader *pfile, cpp_token *token, const uchar *base, (const uchar *)(STR), (LEN)); \ temp_buffer_len += (LEN); \ } \ - } while (0); + } while (0) orig_base = base; ++cur; From patchwork Sun Nov 5 10:07:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 834320 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-465961-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="IFTAspu/"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yVBGJ57Hzz9t34 for ; Sun, 5 Nov 2017 21:08:07 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:cc:message-id:date:mime-version:content-type; q=dns; s=default; b=xVA9Fp0io1S6r9aFfgJGEj/m225x1JY/mYvxWnomgauI47Api6 kKOGRgv1sk1uQjPvNChBByWRQyqcgN3pVU/9o0Tmy/xD2fwcqGPNQo74x+LKeOA3 1AT087tdmlzBQx4CCdpFi7TwgaBVkfWIthWItSLtYqDHd6w/lAsJj/BKM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:cc:message-id:date:mime-version:content-type; s= default; bh=3bgwmkllz7k78nMXvxVIPhKqB14=; b=IFTAspu/56BbYd77ozq5 109ha6c95m7WB854rluwCdwGLC5axy/oR93FKfhP/Sa3Z9pCznFwhHZ4KWgLIm67 wyPv4pu+dOa45VS+kJ1L5ilQyAPxJ58qon9FleOvg29UVSow7P90DTwoI40Wbaqm HQ3+diTwh1Jk2o0ZE7QFdN8= Received: (qmail 12145 invoked by alias); 5 Nov 2017 10:07:57 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 12134 invoked by uid 89); 5 Nov 2017 10:07:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy=explained X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 05 Nov 2017 10:07:55 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-MBX-04.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1eBHqL-0000hV-Db from Tom_deVries@mentor.com ; Sun, 05 Nov 2017 02:07:53 -0800 Received: from [172.30.72.166] (137.202.0.87) by SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Sun, 5 Nov 2017 10:07:49 +0000 From: Tom de Vries Subject: [PATCH 7/7][committed] Remove semicolon after do {} while (0) in DEF_SANITIZER_BUILTIN To: GCC Patches CC: Jakub Jelinek , Marek Polacek Message-ID: <9ca07b87-338f-5154-c946-3e04cbe23dc1@mentor.com> Date: Sun, 5 Nov 2017 11:07:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) Hi, Consider this code in gcc/asan.c: ... #define DEF_SANITIZER_BUILTIN(ENUM, NAME, TYPE, ATTRS) \ do { \ decl = add_builtin_function ("__builtin_" NAME, TYPE, ENUM, \ BUILT_IN_NORMAL, NAME, \ NULL_TREE); \ set_call_expr_flags (decl, ATTRS); \ set_builtin_decl (ENUM, decl, true); \ } while (0); #include "sanitizer.def" if ((flag_sanitize & SANITIZE_OBJECT_SIZE) && !builtin_decl_implicit_p (BUILT_IN_OBJECT_SIZE)) DEF_SANITIZER_BUILTIN (BUILT_IN_OBJECT_SIZE, "object_size", BT_FN_SIZE_CONST_PTR_INT, ATTR_PURE_NOTHROW_LEAF_LIST) ... As explained here ( https://gcc.gnu.org/onlinedocs/cpp/Swallowing-the-Semicolon.html ), we can wrap a multi-statement macro body in a "do {} while (0)" in order to be able to use the macro call as if it were a single statement. However, adding a semicolon after that "do {} while (0)", as is done in DEF_SANITIZER_BUILTIN means you can no longer use it as a single statement (compiling "if DEF_SANITIZER_BUILTIN (...); else ...;" will give an "else without a previous if" compiler error). This problem is then handled in the if stmt by leaving out the semicolon after DEF_SANITIZER_BUILTIN, which is awkward. OTOH, we use .def files with lists of macro calls to generate tables and code. When generating code, it's natural to use a semicolon as the last part of the macro body, in order to separate statements. This patch factors out DEF_SANITIZER_BUILTIN_1 from DEF_SANITIZER_BUILTIN, and uses DEF_SANITIZER_BUILTIN_1 in the if statement as a normal single statement, as made possible by the "do {} while (0)". The original DEF_SANITIZER_BUILTIN is still used with the .def file, as before. Committed as obvious. Thanks, - Tom 2017-11-02 Tom de Vries PR other/82784 * asan.c (DEF_SANITIZER_BUILTIN_1): Factor out of ... (DEF_SANITIZER_BUILTIN): ... here. (initialize_sanitizer_builtins): Use DEF_SANITIZER_BUILTIN_1 instead of DEF_SANITIZER_BUILTIN in if stmt. Add missing semicolon. Signed-off-by: Tom de Vries --- gcc/asan.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/gcc/asan.c b/gcc/asan.c index d5128aa..61e1e7a 100644 --- a/gcc/asan.c +++ b/gcc/asan.c @@ -2804,14 +2804,17 @@ initialize_sanitizer_builtins (void) #define ATTR_PURE_NOTHROW_LEAF_LIST ECF_PURE | ATTR_NOTHROW_LEAF_LIST #undef DEF_BUILTIN_STUB #define DEF_BUILTIN_STUB(ENUM, NAME) -#undef DEF_SANITIZER_BUILTIN -#define DEF_SANITIZER_BUILTIN(ENUM, NAME, TYPE, ATTRS) \ +#undef DEF_SANITIZER_BUILTIN_1 +#define DEF_SANITIZER_BUILTIN_1(ENUM, NAME, TYPE, ATTRS) \ do { \ decl = add_builtin_function ("__builtin_" NAME, TYPE, ENUM, \ BUILT_IN_NORMAL, NAME, NULL_TREE); \ set_call_expr_flags (decl, ATTRS); \ set_builtin_decl (ENUM, decl, true); \ - } while (0); + } while (0) +#undef DEF_SANITIZER_BUILTIN +#define DEF_SANITIZER_BUILTIN(ENUM, NAME, TYPE, ATTRS) \ + DEF_SANITIZER_BUILTIN_1 (ENUM, NAME, TYPE, ATTRS); #include "sanitizer.def" @@ -2820,10 +2823,11 @@ initialize_sanitizer_builtins (void) DEF_SANITIZER_BUILTIN here only as a convenience macro. */ if ((flag_sanitize & SANITIZE_OBJECT_SIZE) && !builtin_decl_implicit_p (BUILT_IN_OBJECT_SIZE)) - DEF_SANITIZER_BUILTIN (BUILT_IN_OBJECT_SIZE, "object_size", - BT_FN_SIZE_CONST_PTR_INT, - ATTR_PURE_NOTHROW_LEAF_LIST) + DEF_SANITIZER_BUILTIN_1 (BUILT_IN_OBJECT_SIZE, "object_size", + BT_FN_SIZE_CONST_PTR_INT, + ATTR_PURE_NOTHROW_LEAF_LIST); +#undef DEF_SANITIZER_BUILTIN_1 #undef DEF_SANITIZER_BUILTIN #undef DEF_BUILTIN_STUB }