http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46316
Summary: [4.6 regression] incorrect loop optimization
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: tree-optimization
AssignedTo: [email protected]
ReportedBy: [email protected]
The Ada runtime (a-calend.adb) is miscompiled at -O2 on x86 at revision 166350.
An infinite loop is generated by the compiler in the UTC_Time_Offset function.
The reduced C testcase is just:
extern void abort (void);
long long __attribute__((noinline,noclone))
foo (long long t)
{
while (t > -4)
t -= 2;
return t;
}
int main(void)
{
if (foo (0) != -4)
abort ();
return 0;
}
e...@atlantis:~/build/gcc/native32> gcc/xgcc -Bgcc -o t t.c -O2
e...@atlantis:~/build/gcc/native32> ./t
^C
e...@atlantis:~/build/gcc/native32>