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: [Fwd: Inlining segfault]



  In message <35BAB683.6E774F7D@taniwha.tssc.co.nz>you write:
  > xgcc: Internal compiler error: program cc1 got fatal signal 11
  > 
  > ---foo.c---
  > static __inline__ unsigned char BCD(unsigned char binval)
  > {
  >   if (binval > 99) return 0x99;
  >   return (((binval/10) << 4) | (binval%10));
  > }
  > 
  > void int1a(unsigned char i)
  > {
  >     (*((unsigned char *)1)) = BCD(i);
  > }
  > -----------
  > 
  > If either line in BCD is commented out or the pointer/cast assignment is
  > changed to a variable (eg i), the error disappears.  Also, the error
  > does not occur for optimisation levels less than 2 (ie -O0 and -O1
  > successfully compile the code).
Fixed in both the mainline and egcs-1.1.  Testcase added to the
mainline tree too.

Thanks!
jeff


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