This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Problem with unsigned long long on ultrasparc
- To: Brad Lucier <lucier at math dot purdue dot edu>
- Subject: Re: Problem with unsigned long long on ultrasparc
- From: Jeffrey A Law <law at hurl dot cygnus dot com>
- Date: Mon, 15 Feb 1999 10:59:48 -0700
- cc: egcs-bugs at cygnus dot com, feeley at iro dot umontreal dot ca, staff at math dot purdue dot edu
- Reply-To: law at cygnus dot com
In message <199808202122.QAA22453@polya.math.purdue.edu>you write:
> 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/eg
> cs-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.
I don't know if anyone ever responded to this bug report.
This problem has been corrected in the mainline egcs sources, but is not
expected to be fixed for the upcoming egcs-1.1.2 minor release.
jeff