http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49782
Summary: Missed optimization due to dependency analysis
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected]
Depends on: 49771
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
In the pr49771.c testcase:
static int a[1000];
int
foo (void)
{
int j;
int i;
for (i = 0; i < 1000; i++)
for (j = 0; j < 1000; j++)
a[j] = a[i] + 1;
return a[0];
}
the dependency analysis doesn't figure out that a[i] for any i between 0 and
999
(but due to size of the array for any i) always overlaps the a[j] from 0 to
999.