huberj at wpi.edu
Sat Apr 1 00:27:07 EST 2000
Interesting gcc bug here...
in both cases this should print 0xDEADBEEF, but in the second case, garbage
unsigned long t1 = 32;
unsigned long long t2 = 64;
printf("%x\n", 1 ? 0xDEADBEEF : t1);
printf("%x\n", 1 ? 0xDEADBEEF : t2);
as expected, the 1 ? ... operation is optimized away, but the compiler seems
to screw things up ...
in the failure case, r4 is not loaded with anything, so this is were the
garbage probably comes from.
This is a greatly simplified version of an actual piece of code (obviously,
as the code above is silly :)
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
More information about the Linuxppc-dev