From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115160 invoked by alias); 7 Jun 2016 08:22:47 -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 115147 invoked by uid 89); 7 Jun 2016 08:22:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Tue, 07 Jun 2016 08:22:36 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 3EE68AC76; Tue, 7 Jun 2016 08:22:33 +0000 (UTC) Date: Tue, 07 Jun 2016 08:22:00 -0000 From: Richard Biener To: Jakub Jelinek cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Fix PR61564 - optimize attribute/pragma accepting any option In-Reply-To: <20160607082137.GN7387@tucnak.redhat.com> Message-ID: References: <20160607082137.GN7387@tucnak.redhat.com> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2016-06/txt/msg00454.txt.bz2 On Tue, 7 Jun 2016, Jakub Jelinek wrote: > On Tue, Jun 07, 2016 at 10:15:39AM +0200, Richard Biener wrote: > > > > This fixes PR61564 by diagnosing (and ignoring) options not marked with > > 'Optimization' being applied to #pragma GCC optimize or via the > > optimize attribute. > > > > The reason is that while we save/restore option state for 'Optimize' > > marked options we don't do that for other options. Thus while such > > options do not end up in the per-function optimize state applying them > > still clobbers the global state. > > > > Bootstrap and regtest running on x86_64-unknown-linux-gnu. > > > > Ok for trunk? > > Ok (though it surprises me we haven't done that from the beginning). Yes, I was surprised by that as well... Richard. > > 2016-06-07 Richard Biener > > > > PR c/61564 > > * c-common.c (parse_optimize_options): Only apply CL_OPTIMIZATION > > options and warn about others. > > > > * gcc.dg/Wpragmas-1.c: New testcase. > > * gcc.dg/Wattributes-4.c: Likewise.