From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13540 invoked by alias); 13 Oct 2015 12:02:13 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 13524 invoked by uid 89); 13 Oct 2015 12:02:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: e06smtp11.uk.ibm.com Received: from e06smtp11.uk.ibm.com (HELO e06smtp11.uk.ibm.com) (195.75.94.107) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Tue, 13 Oct 2015 12:02:11 +0000 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 13 Oct 2015 13:02:07 +0100 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 13 Oct 2015 13:02:07 +0100 X-IBM-Helo: d06dlp01.portsmouth.uk.ibm.com X-IBM-MailFrom: vogt@linux.vnet.ibm.com X-IBM-RcptTo: gcc-patches@gcc.gnu.org Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id EC5D917D805D for ; Tue, 13 Oct 2015 13:02:11 +0100 (BST) Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t9DC26Lm18284618 for ; Tue, 13 Oct 2015 12:02:06 GMT Received: from d06av03.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t9DC26lq028413 for ; Tue, 13 Oct 2015 06:02:06 -0600 Received: from bl3ahm9f.de.ibm.com (dyn-9-152-212-194.boeblingen.de.ibm.com [9.152.212.194]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t9DC24Bm028291; Tue, 13 Oct 2015 06:02:04 -0600 Received: from dvogt by bl3ahm9f.de.ibm.com with local (Exim 4.76) (envelope-from ) id 1ZlyHM-0005mM-2G; Tue, 13 Oct 2015 14:02:04 +0200 Date: Tue, 13 Oct 2015 12:02:00 -0000 From: Dominik Vogt To: gcc-patches@gcc.gnu.org Cc: Andreas Krebbel , Stefan Liebler Subject: [PATCH] Fix "#pragma GCC pop_options" warning. Message-ID: <20151013120203.GA21522@linux.vnet.ibm.com> Reply-To: vogt@linux.vnet.ibm.com Mail-Followup-To: gcc-patches@gcc.gnu.org, Andreas Krebbel , Stefan Liebler MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="u3/rZRmxL6MmkK24" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15101312-0041-0000-0000-0000062310B9 X-SW-Source: 2015-10/txt/msg01224.txt.bz2 --u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 777 When "#pragma GCC pop_options" is used on a platform without support for "#pragma GCC target", Gcc emits a warning. As pop_options is useful on targets without the target pragma to restore optimizations flags, the warning should be removed. The attached patch does that rather inelegantly by checking if the pragma_parse hook points to the default implementation. I could't think of a similarly terse but less clumsy way. Suggestions for a better test are very welcome. gcc/ChangeLog: * c-pragma.c: Include targhooks.h. (handle_pragma_pop_options): Do not call default_target_option_pragma_parse to prevent its warning when using "#pragma GCC pop_options" on platforms that do not support "#pragma GCC target". Ciao Dominik ^_^ ^_^ -- Dominik Vogt IBM Germany --u3/rZRmxL6MmkK24 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-Fix-pragma-GCC-pop_options-warning.patch" Content-length: 1189 >From d149dd8b9d6c9f720809de3839f2ad5a6825f7e5 Mon Sep 17 00:00:00 2001 From: Dominik Vogt Date: Tue, 13 Oct 2015 12:55:21 +0100 Subject: [PATCH] Fix "#pragma GCC pop_options" warning. --- gcc/c-family/c-pragma.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/c-family/c-pragma.c b/gcc/c-family/c-pragma.c index 3c34800..b209b7b 100644 --- a/gcc/c-family/c-pragma.c +++ b/gcc/c-family/c-pragma.c @@ -38,6 +38,7 @@ along with GCC; see the file COPYING3. If not see #include "tm_p.h" /* For REGISTER_TARGET_PRAGMAS (why is this not a target hook?). */ #include "target.h" +#include "targhooks.h" #include "diagnostic.h" #include "opts.h" #include "plugin.h" @@ -997,7 +998,9 @@ handle_pragma_pop_options (cpp_reader *ARG_UNUSED(dummy)) if (p->target_binary != target_option_current_node) { - (void) targetm.target_option.pragma_parse (NULL_TREE, p->target_binary); + if (targetm.target_option.pragma_parse + != default_target_option_pragma_parse) + (void) targetm.target_option.pragma_parse (NULL_TREE, p->target_binary); target_option_current_node = p->target_binary; } -- 2.3.0 --u3/rZRmxL6MmkK24--