extern "C" void abort (void); inline void *operator new (__SIZE_TYPE__, void *__p) throw () { return __p; }
int __attribute__((noinline)) foo(void) { float f = 0; int *i = new (&f) int (1); return *(int *)&f; } CCP produces <bb 2>: f = 0.0; D.2121_3 = &f; D.2107_4 = (int *) &f; if (D.2107_4 != 0B) goto <bb 3>; else goto <bb 4>; and while it knows during propagation that D.2107_4 != 0B is true this doesn't have any effect during substitute_and_fold. -- Summary: CCP doesn't fold all comparisons it could Product: gcc Version: 4.5.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P3 Component: tree-optimization 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=41428