The asm for the following two functions should be the same. int f(int a) { return 10 - ~a; } int f1(int a) { return a + 11; }
Found while reading LLVM's instruction combiner. -- Summary: Fold does not reduce C - ~a into a + (C+1) Product: gcc Version: 4.1.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P2 Component: middle-end 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 OtherBugsDependingO 19987 nThis: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23666