Bernd Schmidt wrote:
It appears that spill_reg_index is only set up for registers that go
through the choose_reload_regs process, not for the ones selected during
find_reloads.  That's probably a bad thing, as a reg_rtx chosen in
find_reloads could be used as a spill reg in a previous insn (as in your
example).

Yes, I think that is indeed what's going on.  I wonder if this issue
of spill_reg_index is also manifesting itself in:

      /* The following if-statement was #if 0'd in 1.34 (or before...).
         It's reenabled in 1.35 because supposedly nothing else
         deals with this problem.  */

      /* If a register gets output-reloaded from a non-spill register,
         that invalidates any previous reloaded copy of it.
         But forget_old_reloads_1 won't get to see it, because
         it thinks only about the original insn.  So invalidate it here.
         Also do the same thing for RELOAD_OTHER constraints where the
         output is discarded.  */
      if (i < 0
        ...

and the code following in emit_reload_insns?  Perhaps if spill_reg_index
took account of registers selected during find_reloads then this could
be simplified too.

So what do you think is the best approach to fix all of this? :-)

Mark

Reply via email to