Ben Pfaff <[email protected]> writes: > I now suspect that this is a problem caused by changes in > optimization, since float-format.c does some things that should > be OK but I can imagine a compiler getting wrong (and maybe there > is some technicality that I have missed so far). Can you try > building with "-O0" instead of the default "-O2"?
I found out where GCC 4.4 was installed on the GCC compile farm and managed to isolate the problem, which indeed appears to be a bug in GCC. When the following test program is built with "gcc -O2 -m64" or "gcc -O3 -fno-inline -m64" using GCC 4.4.0 on sparc64, it prints 0, but it should print 12345678. I have filed this in GCC Bugzilla: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40668 ---------------------------------------------------------------------- #include <stdint.h> #include <stdio.h> #include <string.h> /* Stores 32-bit unsigned integer X at P, which need not be aligned. */ static void put_uint32 (uint32_t x, void *p) { memcpy (p, &x, sizeof x); } void store_12345678 (int type, void *number) { switch (type) { case 1: printf ("got here\n"); put_uint32 (0x12345678, number); break; case 7: put_uint32 (0, number); break; case 8: put_uint32 (0, number); break; case 9: put_uint32 (0, number); break; } } int main (void) { uint32_t x; store_12345678 (1, &x); printf ("%x\n", (unsigned int) x); return 0; } -- Ben Pfaff http://benpfaff.org _______________________________________________ pspp-dev mailing list [email protected] http://lists.gnu.org/mailman/listinfo/pspp-dev
