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: Problem with unsigned long long on ultrasparc



  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


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