On 09/10/2016 01:17 AM, Segher Boessenkool wrote:
On Fri, Sep 09, 2016 at 04:40:12PM -0600, Jeff Law wrote:
Right now the dataflow is conservatively correct WRT the return register.
And conservatively incorrect wrt all other callee-saved regs!
But prior to prologue/epilogue insertion it shouldn't matter. In fact,
explicit references to callee saved regs prior to register allocation
has always been problematical.
I do think our handling of life information for callee-saved regs after
insertion of the prologue/epilogue could be improved.
In a separate shrink wrapped world ISTM that we want to move to a model
where the return insn itself is a use of the appropriate callee saved
regs. If we did that I suspect some of the hacks from the separate
shrink wrapping kit would just "go away".
Attaching actual USEs to those insns is obviously problematical though
from a recognition standpoint. It'd probably have to be structured more
like what we do with CALL_INSNs to mark registers used/set.
If we made the change you want to make than the dataflow becomes overly
optimistic about the range over which the return register is live prior
to inserting the prologue/epilogue into the insn chain.
This seems unsafe to me.
Yes, but so does the current situation. And it all seems to work
nevertheless :-)
But that doesn't make it right...
Jeff