egcs-1.1b uint64_t alpha miscompile
a sun
asun@saul5.u.washington.edu
Fri Sep 25 09:20:00 GMT 1998
consider the following code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
getval(char *buf)
{
u_int64_t val;
val = 0xf87ac000000000;
printf("val = %lX\n", val);
memcpy(buf, &val, sizeof(val));
memcpy(&val, buf, sizeof(val));
printf("val = %lX\n", val);
}
int main()
{
char buf[100];
getval(buf);
}
on my udb, it prints out two values for val if i compile with
-O. needless to say, using 32-bit values, doing the memcpy's within
main(), and compiling without -O all work fine. given that alpha's are
natively 64-bit, i was a little shocked to see this pop up.
anyways, is this a known egcs problem that's hopefully already fixed?
some specifics:
RH 5.1/axp w/ glibc-2.0.7-13
gcc version egcs-2.91.57 19980901 (egcs-1.1 release) w/ haifa
scheduling enabled
-a
More information about the Gcc-bugs
mailing list