https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111522

--- Comment #2 from Mathieu Malaterre <malat at debian dot org> ---
(In reply to Andrew Pinski from comment #1)
> I think this is just broken code.
> 
> It does:
> #define HWY_BEFORE_NAMESPACE()                                              
> \
>   HWY_PUSH_ATTRIBUTES("altivec,vsx,power8-vector"                           
> \
>                       ",cpu=power10")
> 
> But does not do a pop before the main function.
> 
> And then you are testing on power8 which obvious does not have all of the
> instructions as power10 ...
> Why it works without -flto is just pure accident not using the instructions
> that are not in power8.
> 
> Anyways I suspect this is too much reduced testcase. So you might need to
> provide the original one.

I reported this one up after reading #111380. Honestly there is no "wrong-code"
here. The LTO case is simply an eager init of global variable, while the
non-LTO is a lazy loading of global var. So the original (upstream) code is
somewhat buggy as it rely on lazy init for global var.

Could someone please just confirm that eager init of global var is expected in
LTO case, we could just close this one.

Reply via email to