This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/6056: ICE on legal code with when optimizations higher that -O (ia64 only)
- From: jakub at gcc dot gnu dot org
- To: djohnson at osc dot edu, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org
- Date: 26 Mar 2002 18:18:50 -0000
- Subject: Re: c++/6056: ICE on legal code with when optimizations higher that -O (ia64 only)
- Reply-to: jakub at gcc dot gnu dot org, djohnson at osc dot edu, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
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