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

--- Comment #6 from Zdenek Sojka <zsojka at seznam dot cz> ---
(In reply to Zdenek Sojka from comment #5)
> Created attachment 47738 [details]
> only partially reduced testcase, with always defined shifts
> 
> It also needs more flags to reproduce:
> -Os -fno-expensive-optimizations -fno-forward-propagate -fno-inline
> -fno-ipa-vrp -fno-tree-bit-ccp -fno-tree-ter
> 
> (not all of those are needed; switching to -Og might help to reduce the
> number of needed flags)
> 
> I've just deleted my gcc repo + binaries, so I can't test it atm.

Actually, only -Og is enough even for that testcase:

$ powerpc64le-unknown-linux-gnu-gcc -Og testcase-min1.c -static -w && ./a.out 
00000000000000000000000000000000
(wrong)

$ powerpc64le-unknown-linux-gnu-gcc -O0 testcase-min1.c -static -w && ./a.out 
00000000000000010000000000000000
(correct)

Reply via email to