From: Richard Sandiford <rdsandif...@googlemail.com> Date: Wed, 02 May 2012 20:37:58 +0100
> I think the DSE assuption is fair though. If you reuse MEMs like this, > then they're no longer just serving the purpose described by MEM_EXPR. I think what Sparc does is fair, so if you are going to suggest that I re-pop these values into new stack slots I'm going to have a hard time swallowing that. In fact, using the incoming argument slots when passing outgoing arguments by reference is exactly what I want the sparc backend to be doing. Furthermore, in the future, I'd like the compiler to be able to use these argument slots when stack temporaries are necessary since every sparc stack frame has to allocate 6 argument slots even if no arguments are passed to the function. This argument slot re-use is a rather common optimization in hand written sparc assembler because this allows us to avoid having to allocate a register window and a stack frame at all, and thus end up also with a leaf procedure even when we need stack temporaries.