c++/6056: ICE on legal code with when optimizations higher that -O (ia64 only)

jakub@gcc.gnu.org jakub@gcc.gnu.org
Tue Mar 26 10:40:00 GMT 2002


Synopsis: ICE on legal code with when optimizations higher that -O (ia64 only)

State-Changed-From-To: open->analyzed
State-Changed-By: jakub
State-Changed-When: Tue Mar 26 10:18:49 2002
State-Changed-Why:
    It is actually code with undefined behaviour (because
    it does invalid type punning), but no matter what
    gcc probably shouldn't ICE on it.
    Simplified into:
    extern unsigned long d[];
    unsigned long foo (unsigned char *x, int y)
    {
      unsigned long a = 0, c = 0;
      unsigned short *e = (unsigned short *) &a;
      int i, b;
    
      for (i = 0; i < y; i++)
        c = (c << 1) ^ d[i & 3];
      if (i & 3) a ^= c;
    
      a *= 1879048201;
      e[0] += e[1];
      return a;
    }
    at -O2.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6056



More information about the Gcc-bugs mailing list