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.

> Certainly wouldn't disagree that the ABIs ought to own defining this 
> stuff.  It's just an area where they've been weak in the past.

Oh yes, indeed.  Even relatively new psABIs don't specify this explicitely 
:-/


Ciao,
Michael.

Reply via email to