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