[Bug tree-optimization/109442] Dead local copy of std::vector not removed from function

2023-04-11 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109442 --- Comment #3 from Jonathan Wakely --- Ah, maybe the problem is that the library code manually elides destroying the elements, precisely because it's a no-op. So we don't actually destroy the elements, which means the compiler might think

[Bug tree-optimization/109442] Dead local copy of std::vector not removed from function

2023-04-11 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109442 --- Comment #2 from Jonathan Wakely --- Neither v nor v1 escapes the function, so I don't think operator delete can inspect them. The destructor doesn't inspect the contents, it just destroys the elements (which is a no-op for int) and then

[Bug tree-optimization/109442] Dead local copy of std::vector not removed from function

2023-04-11 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109442 Richard Biener changed: What|Removed |Added Keywords||missed-optimization