This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR61564 - optimize attribute/pragma accepting any option
- From: Richard Biener <rguenther at suse dot de>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 7 Jun 2016 10:22:33 +0200 (CEST)
- Subject: Re: [PATCH] Fix PR61564 - optimize attribute/pragma accepting any option
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1606071011100 dot 1493 at t29 dot fhfr dot qr> <20160607082137 dot GN7387 at tucnak dot redhat dot com>
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.