Testcase: int f(void) { int t; int *a = new int[1024]; int *b = new int[1024]; *a = 1; *b = 2; t = *a; delete a; delete b; return t; }
the return is not turned into 1 but still have "return t" in the final_cleanup. -- Summary: builtin array operator new is not marked with malloc attribute Product: gcc Version: 4.1.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P2 Component: c++ 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=23383