Apple's gcc -fast. revisited...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have been having weird behaviour with Apple's gcc...

Consider the following program:

#include <stdio.h>

main(int argc, char **argv) {

  unsigned long long y;

  y = 0xffcc000000000000ULL;

  printf("%llx\n",y);

}

Using

gcc version 3.3 20030304 (Apple Computer, Inc. build 1435)

if I compile it just with "gcc -o test test.c" and run it, I get the
output of

ffcc000000000000



If I use "gcc -fast -o test test.c" and then run it, I get

0




But if I add a few more options, just for fun, 

gcc -fast -mcpu=970 -mtune=970 -mpowerpc64 -o test test.c

then it reverts to 

ffcc000000000000




Am I doing something dumb with the use of "unsigned long long" or is
that genuinely a problem?

I have a range of other, but much more complicated programs that either
crash, or cause the copmiler to barf when compiled with "-fast", but on
the other hand, using it with the other flags gives me a huge speedup on
one program that I want to run!




-- 
Dr. Gordon Royle, http://www.csse.uwa.edu.au, gordon(AT)csse.uwa.edu.au
--



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux