This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: egcs-1.1b uint64_t alpha miscompile
- To: a sun <asun at saul5 dot u dot washington dot edu>
- Subject: Re: egcs-1.1b uint64_t alpha miscompile
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Wed, 13 Jan 1999 02:40:53 -0700
- cc: egcs-bugs at cygnus dot com
- Reply-To: law at cygnus dot com
In message <199809251620.JAA08523@saul5.u.washington.edu>you write:
>
> 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?
This seems to be working find with the current egcs snapshot.
Thanks,
jeff