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] Make warn_inline Optimization option.


On Tue, Jan 7, 2020 at 4:46 PM Jan Hubicka <hubicka@ucw.cz> wrote:
>
> > On Tue, Jan 7, 2020 at 3:26 PM Jan Hubicka <hubicka@ucw.cz> wrote:
> > >
> > > > Err - Optimization also lists it in some -help section?  It's a Warning
> > > > option and certainly we don't handle per-function Warnings in general
> > > > (with LTO) even though we have #pragma GCC diagnostic, no?
> > > >
> > > > I'm not sure why we force warn_inline to zero with -O0, it seems much
> > > > better to guard false warnings in some other way for -O0?
> > >
> > > Well, we can do that with warn_inline, but in general we do want to
> > > stream late warnings (so things like -Wmaybe-uninitialized works sort of
> > > as expected for -flto). So I guess we want way to mark option as part of
> > > TARGET_OPTIMIZATION_NODE even though it is not realy an optimization
> > > option but parameter, warning or semantic change.
> >
> > Given all warning options can be enabled/disabled via #pragma GCC diagnostic
> > all Warning annotated options should be implicitely 'Optimization' for
> > the purpose
> > of LTO streaming then?
>
> Well, perhaps they can be marked but for late optimizations this does
> not work
> __attribute__ ((warning("haha"))) test() { }
> #pragma gcc diagnostic ignore "-Wattribute-warning"
> test2() { test(); }
>
> We have many warning options but only few of them are late - it would be
> nice to have them explicitly marked somehow IMO (by design and to avoid
> streaming a lot of useless flags)

Hmm, indeed.  Well, I belive we use the 'Optimization' flag for other purposes
than only triggering LTO streaming and option save/restore, so we need another
flag that only triggers save/restore then (and also allow us to avoid
dropping the
flag at lto-option streaming time where we currently drop all warning options).

Richard.

> honza
>
> >
> > Richard.
> >
> > > Honza


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