This is the mail archive of the gcc@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]
Other format: [Raw text]

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


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