The following should not abort but does at -O3. void abort(void); void foo (signed char a) { if (a - 0x7F > 1) abort(); } int main() { unsigned char b; for(b = 0;b <0xFF;b++) foo (b); }
-- Summary: [4.1 Regression] wrong code for casts and scev Product: gcc Version: 4.0.1 Status: UNCONFIRMED Keywords: wrong-code Severity: critical 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=22236