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

--- Comment #48 from Richard Biener <rguenth at gcc dot gnu.org> ---
OK, so 'location' is relevant for refs like *q_19, and indicates the value of
'q_19' which would need to be remembered along with the stored value.  I had
added gcc.dg/torture/20211118-1.c for this which fails when allowing
CONSTANT_CLASS_P values (so values we can remember).  Unfortunately the
clobber that's relevant here suffers from the same issue - we do not
handle recovering the location to clobber for the store to be materialized
on the alternate edge.

So the only simple improvement I can offer is when the location has no
loop variant components.

A further enhancement would be to record the store location in another
IV so we can properly re-materialize the last store(s).  Profitability
would tank, of course, and for clobbers this might be not a good idea
anyway.  For clobbers to loop variant addresses we could also simply decide
to drop them alltogether (we'd have to drop them in-loop, of course).

Reply via email to