[Bug ipa/99670] IPA CP and SRA pass order issue?
jamborm at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Oct 31 16:35:57 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99670
--- Comment #1 from Martin Jambor <jamborm at gcc dot gnu.org> ---
I don't think this is a problem with interaction in between the two
passes, IPA-SRA obscures the picture a bit but is not really involved.
The lost opportunity here is that IPA-CP cannot propagate the constant
across the call from foo to bar because we do not have a jump function
that would say that a call argument is a reference to a part of
PARM_DECL and we guarantee that nothing has clobbered what it points
to before the call.
If foo also accepted a pointer to a structure, then our jump functions
can represent that and we can store a compile time constant to k. In
this case IPA-SRA actually produces a useless parameter but I hope I
have a patch for that.
Cloning bar for all contexts of course means that we do a little bit
of extra work without any benefit (but also without any run-time or
text size cost) but generally I'm afraid that maybe a bit difficult to
detect and fix.
More information about the Gcc-bugs
mailing list