This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Problem with unsigned long long on ultrasparc
- To: egcs-bugs at cygnus dot com
- Subject: Problem with unsigned long long on ultrasparc
- From: Brad Lucier <lucier at math dot purdue dot edu>
- Date: Thu, 20 Aug 1998 16:22:03 -0500 (EST)
- Cc: lucier at math dot purdue dot edu, feeley at iro dot umontreal dot ca, staff at math dot purdue dot edu
Here's a simple program:
#include <stdlib.h>
#include <stdio.h>
int main() {
unsigned long long a[10];
#define BASE_DIV_2 (((unsigned long long) 1) << 63)
a[0] = -1;
printf("%ull\n", a[0]);
printf("%ull\n", BASE_DIV_2);
if (a[0] < BASE_DIV_2)
printf("Problem\n");
else
printf("OK\n");
}
With this version of gcc:
peano-30% gcc -v
Reading specs from /opt/egcs-19980816/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.91.54/specs
gcc version egcs-2.91.54 19980816 (gcc2 ss-980609 experimental)
I get:
peano-31% gcc -O1 -o testlong testlong.c
peano-32% testlong
4294967295ll
2147483648ll
OK
but
peano-27% gcc -O1 -mcpu=ultrasparc -o testlong testlong.c
peano-28% testlong
4294967295ll
2147483648ll
Problem
This is on Solaris 2.5.1.
Brad Lucier lucier@math.purdue.edu