[Bug tree-optimization/104515] [11/12/13/14/15 Regression] trivially-destructible destructors interfere with loop optimization - maybe related to lifetime-dse.

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jul 17 08:37:45 GMT 2024


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104515

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think not re-emitting the clobber on the exit might be OK semantically - it's
at most a missed optimization for a store.  I think it's also OK for the
stack slot sharing logic as any object becoming live after a clobber
would need to have a mention inbetween the clobber and the exit.  I'll note
that if that's not OK then duplicating the clobber wouldn't either.
As we don't know whether the object we store to ends its lifetime (it's only
a may-alias) we can't do both - extend its lifetime and preserve the
original one.

We could maybe move the clobber (duplicating it to each edge but removing
it from the loop body).

I'm testing a patch.


More information about the Gcc-bugs mailing list