int foo(int i) { if (((unsigned)(i + 1)) * 4 == 0) return 1; return 0; }
extern void abort(void); int main() { if (foo(0x3fffffff) == 0) abort (); return 0; } This goes wrong in extract_muldiv and is exposed by folding X * C CMP 0 to X CMP 0 for undefined overflow. -- Summary: [4.3 Regression] folds unsigned multiplication == 0 to true Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rguenth at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33779