The following 2 functions should be compiled to the same assembly.
This is one of Briggs' compiler benchmarks.
void vnum_test11(int *data)
{
int n;
int stop = data[3];
int j = data[1];
int k = j;
int i = 1;
for (n=0; n<stop; n++) {
if (j != k) i = 2;
if (i != 1) k = 2;
data[data[2]] = 2;
}
data[1] = i;
}
void vnum_result11(int *data)
{
int n;
int stop = data[3];
for (n=0; n<stop; n++)
data[data[2]] = 2;
data[1] = 1;
}
--
Summary: missed value numbering optimization (conditional value
numbers)
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dann at godzilla dot ics dot uci dot edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30100