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.