Like PR 20083 but a slightly different case, in a way this is missed jump crossing. The following three functions should produce the same assembly code, f2 is the most optimal code. Right now on the tcb only f1 and f2 are the same.
int f(int *i, int *j, int *l) { int k = 0; if (*i) k = 1; if (*j) k = 1; if (*l) k = 1; return k; } int f1(int *i, int *j, int *l) { int k = 0; if (*i) k = 1; else if (*j) k = 1; else if (*l) k = 1; return k; } int f2(int *i, int *j, int *l) { int k = 0; if (*i) return 1; if (*j) return 1; return (*l)!=0; } -- Summary: missed optimization with conditional and loads and cross jumping Product: gcc Version: 4.0.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P2 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20084