[Bug rtl-optimization/83124] wrong code on arm-linux-gnueabi-gcc with -O3 optimization
yangyibiao at nju dot edu.cn
gcc-bugzilla@gcc.gnu.org
Thu Nov 23 11:34:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83124
--- Comment #2 from Yibiao Yang <yangyibiao at nju dot edu.cn> ---
Thanks and Very sorry for this wrong bug report.
(In reply to ktkachov from comment #1)
> The code has undefined behaviour.
> If you remove the -w, two of the warnings are:
> bad.c:5:10: warning: initialization of ‘int *’ from incompatible pointer
> type ‘union <anonymous> *’ [-Wincompatible-pointer-types]
> int *c = &b;
> ^
> bad.c:7:11: warning: initialization of ‘long int *’ from incompatible
> pointer type ‘union <anonymous> *’ [-Wincompatible-pointer-types]
> long *d = &b;
> ^
>
> These break strict-aliasing rule.
> So if you use -fno-strict-aliasing you'll get FFFF as the output at all
> optimisation levels
More information about the Gcc-bugs
mailing list