On Fri, Nov 13, 2020 at 3:49 PM Segher Boessenkool
<segher(a)kernel.crashing.org> wrote:
Hi!
On Fri, Nov 13, 2020 at 10:59:26AM -0800, Nick Desaulniers wrote:
> The `optimize` attribute is both non-portable across toolchains (hence
> this warning)
Like *all* GCC extensions.
> and a little quirky in GCC.
How so? Don't spread FUD please, say what *is* wrong, then people can
decide for themselves whether they want it or not.
Spread FUD? Ard literally sent TO YOU:
https://lore.kernel.org/lkml/CAMj1kXHxX+u5-cN0v3SLdqZTSiKsWsFOvc2SC5=-Sca...,
and it was referenced again in
https://lore.kernel.org/lkml/20201028081123.GT2628@hirez.programming.kick....
Was it FUD when Ard sent it to you? Did you even read the link you
dropped from my reply, which is what Ard quoted?
https://gcc.gnu.org/wiki/FAQ#optimize_attribute_broken
If it wasn't FUD when Ard sent it, why is it suddenly when I do?
We (GCC) do document it as:
Not every optimization option that starts with the -f prefix
specified by the attribute necessarily has an effect on the
function. The 'optimize' attribute should be used for debugging
purposes only. It is not suitable in production code.
The optimize attribute is for setting/resetting flags on a function
granularity. Not all flags can be flipped per function. The SSP flags
work fine though, AFAIK. But don't use it for production, there are no
guarantees.
Cheers,
Segher
--
Thanks,
~Nick Desaulniers