https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78713
--- Comment #4 from Avi Kivity <a...@cloudius-systems.com> --- This bug has a cousin https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61982 where the optimizer doesn't eliminate a store to an object that is about to be destroyed. While for sure it is easier to implement in the library, I think there is a lot of potential for similar optimizations if the optimizer does get the information it craves.