This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: new gcc bug
- From: Paul dot Zimmermann at loria dot fr (Paul Zimmermann)
- To: falk dot hueffner at student dot uni-tuebingen dot de
- Cc: gcc-bugs at gcc dot gnu dot org, Vincent dot Lefevre at loria dot fr, tege at swox dot com,bangerth at ices dot utexas dot edu
- Date: Tue, 24 Jun 2003 09:53:48 +0200
- Subject: Re: new gcc bug
From: Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
Date: 23 Jun 2003 18:09:23 +0200
Paul.Zimmermann@loria.fr (Paul Zimmermann) writes:
int main() {
unsigned long c = 70423129, q;
q = (~((unsigned long) 0)) / c;
printf ("q=%lu\n", q);
}
> gcc version 3.2 20020329 (experimental)
> Given output:
> bash-2.04$ ./a.out
> q=4243519447
>
> Expected output:
> bash-2.04$ cc bug.c; ./a.out
> q=60
I cannot reproduce this on ia64-linux with gcc 3.2.3 (or any other
release). Note that the correct result is 261941557207, not 60, since
long has 64 bit on ia64.
But under ia64-hpux, long has only 32 bits:
printf ("sizeof(unsigned long)=%u\n", sizeof(unsigned long));
printf ("sizeof(unsigned long long)=%u\n", sizeof(unsigned long long));
sizeof(unsigned long)=4
sizeof(unsigned long long)=8
Please try to reproduce this bug with our current release (3.3). If it
is still there, please enter it into our database at
http://gcc.gnu.org/bugzilla/.
Unfortunately I cannot find gcc-3.3 on spe175.testdrive.hp.com.
Paul