The following 2 functions should be compiled to the same assembly. This is one of Briggs' compiler benchmarks.
void strength_test4(int *data) { int i; if (data[1]) { i = 2; goto here; } i = 0; do { i = i + 1; here: data[data[2]] = 2; } while (i * 21 < data[3]); } void strength_result4(int *data) { int i; if (data[1]) { i = 42; goto here; } i = 0; do { i = i + 21; here: data[data[2]] = 2; } while (i < data[3]); } -- Summary: missed strength reduction optimization (irreducible loops) 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=30102