https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109442
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Status|UNCONFIRMED |NEW Ever confirmed|0 |1 CC| |jwakely.gcc at gmail dot com, | |rguenth at gcc dot gnu.org Last reconfirmed| |2023-04-11 Version|unknown |13.0 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- So we're failing to DSE _13 = pretmp_25 - pretmp_63; if (_13 > 4) goto <bb 7>; [97.30%] else goto <bb 6>; [2.70%] <bb 6> [local count: 14278734]: if (_13 == 4) goto <bb 8>; [34.00%] else goto <bb 9>; [66.00%] <bb 7> [local count: 913536322]: _23 = (long unsigned int) _13; __builtin_memmove (_37, pretmp_63, _23); goto <bb 9>; [100.00%] <bb 8> [local count: 34511373]: _24 = *pretmp_63; *_37 = _24; <bb 9> [local count: 542742079]: operator delete (_37, _49); because I think the DTOR / overloaded global delete might inspect the vector contents. So I'm not sure it would be valid to elide the memmove/store. When the stores would be elided we'd DCE the new/delete pair as well.