On Wed, Jan 8, 2020 at 11:22 AM Jan Hubicka <hubi...@ucw.cz> wrote: > > > > > 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). > > Yep. I was not aware of any other use of "Optimization" flag, but > definitly it is misnamed in this context (as is OPTIMIZATION_NODE btw).
I think it sets CL_OPTIMIZATION and we have in opts.c case CL_WARNING: description = _("The following options control compiler warning messages"); break; case CL_OPTIMIZATION: description = _("The following options control optimizations"); break; so depenent on the enum value we'll get the wrong one for warnings and the above suggests those flags are not to be set at the same time. Likewise --params, btw: case CL_PARAMS: description = _("The following options control parameters"); break; so that really asks for a separate CL_* flag (and maybe implicitely setting that for all CL_OPTIMIZATION flags). Richard. > Honza > > > > Richard. > > > > > honza > > > > > > > > > > > Richard. > > > > > > > > > Honza