https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61564
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |manu at gcc dot gnu.org
--- Comment #6 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #3)
> It looks like both the pragma and the attribute accept any kind of -f/-O
> options
> regardless of them being marked as 'Optimization' in the .opt file. They
> get applied via decode_options and thus may have side-effects not reflected
> by
> cl_optimization_save/restore.
>
> I have a patch to issue
>
> /tmp/t.c:2:9: warning: bad option -fno-lto to pragma attribute [-Wpragmas]
> #pragma GCC optimize ("-fno-lto")
> ^~~
to pragma attribute?
Do you mean "to pragma 'optimize'"?
This would be even prettier:
ret = false;
warning (attr_p ? OPT_Wattributes : OPT_Wpragmas,
attr_p ? "bad option %qs to attribute %<optimize%>"
: "bad option %qs to pragma %<optimize>%",
decoded_options[i].orig_option_with_args_text);
continue;