This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: egcs-1.1b uint64_t alpha miscompile




  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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]