This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
bug in current gcc-3.4 20030916
- From: Enache Adrian <enache at rdslink dot ro>
- To: gcc at gcc dot gnu dot org
- Date: Sat, 20 Sep 2003 10:39:14 +0300
- Subject: bug in current gcc-3.4 20030916
$ cat bug.c
#include <stdio.h>
int main()
{
int hicount = 0;
unsigned char *c;
char *str = "\x7f\xff";
for (c = (unsigned char *)str; *c ; c++) {
if (!(((unsigned int)(*c)) < 0x80)) hicount++;
}
printf("%d\n", hicount);
return 0;
}
$ gcc -O bug.c
$ ./a.out
2
<the same with -O2, -O3, etc>
$ gcc bug.c
$ ./a.out
1
<also correct with 3.3.1, 3.2, etc>
$ gcc -v
Reading specs from /usr/y/gcc/lib/gcc/i386-unknown-freebsd5.1/3.4/specs
Configured with: '/arc/gcc/configure' '--prefix=/usr/y/gcc '--enable-languages=a
da,c,c++,f77
Thread model: posix
gcc version 3.4 20030916 (experimental)
Regards,
Adi