egcs-1.1.2 -O flag and macro bug

Jeffrey A Law law@upchuck.cygnus.com
Fri Apr 30 23:15:00 GMT 1999


  In message < 14118.58200.176215.39441F@mail.SoftAgency.co.jp >you write:
  > --Multipart_Wed_Apr_28_19:30:48_1999-1
  > Content-Type: text/plain; charset=US-ASCII
  > 
  > Hello,
  > When compile next test1.c file with -O options, egcs create incorrect code.
  > but without -O option, code is correct.
  > this test1.c must show `1', but, binary created with -O option return `0'.
  > 
  > === test1.c ===
  > #include <stdio.h>
  > typedef unsigned char uchar;
  > #define issjishead(c) ((0x81<=(uchar)(c) && (uchar)(c)<=0x9f) || (0xe0<=(uc
  > har)(c) && (uchar)(c)<=0xfc))
  > int main()
  > {
  >   int a = -107;
  >   printf("%d\n", issjishead(a));
  > }
This works fine in the current snapshots.

jeff


More information about the Gcc-bugs mailing list