This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR61564 - optimize attribute/pragma accepting any option


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  <rguenther@suse.de>
> > 
> > 	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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]