On 4/16/19 9:35 AM, Michael Matz wrote: > Hi, > > On Tue, 16 Apr 2019, Jeff Law wrote: > >>> I still don't think that what you want follows. Imagine this: >>> >>> int foo (int i) { ++i; return i; } >>> >>> To claim that this function is anything else than const+pure seems weird >>> (in fact this function doesn't access anything that must lie in memory at >>> all). Now take your off-the-mill ABI that passes arguments on stack, and >>> an only slightly bad code generator, i.e. -O0 on i386. You will get an >>> modification of the argument slot: >> Ugh. Good point. But then we're back to the problem with handling of >> REG_EQUIV notes for stores into the argument space. If the callee owns, >> has been declared pure/const, but can clobber things like you've shown, >> then a REG_EQUIV note on those slots must be avoided. > > Yes, if we want to be extra precise a REG_EQUAL note would be okay before > the call insn (but not very useful post regalloc), but a REG_EQUIV note is > plain wrong for argument slots if there are uses of the destination > register after the call. Right. We could have a REG_EQUAL note, but I doubt it's helpful at all.
So going back to Jakub's patch... I think the discussion points to avoiding the REG_EQUIV notes for outgoing argument slots. Jeff