Mark Shinwell wrote:
> Do you think it should be the case that, at the point below, _any_ reload
> with reg_rtx corresponding to a hard register should have the relevant
> bit set in reload_spill_index?

I think so.  I'm attaching a patch below.  It appears to have no effect
on all code I've tried - does it fix your test case?
> +         if (rld[r].when_needed == RELOAD_FOR_INPUT
> +             && rld[r].reg_rtx
> +             && REGNO (rld[r].reg_rtx) < FIRST_PSEUDO_REGISTER)
> +           {
> +             reload_spill_index[r] = REGNO (rld[r].reg_rtx);
> +             mark_reload_reg_in_use (j,
> +                                     rld[r].opnum,
> +                                     rld[r].when_needed,
> +                                     rld[r].mode);

I don't think we need mark_reload_reg_in_use, as there are other
mechanisms preventing conflicts.


Bernd

-- 
This footer brought to you by insane German lawmakers.
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 40368
Geschaeftsfuehrer Thomas Wessel, William A. Martin, Margaret Seif
Index: reload1.c
===================================================================
--- reload1.c   (revision 124499)
+++ reload1.c   (working copy)
@@ -5556,7 +5556,14 @@ choose_reload_regs (struct insn_chain *c
   for (j = 0; j < n_reloads; j++)
     {
       reload_order[j] = j;
-      reload_spill_index[j] = -1;
+      if (rld[j].reg_rtx != NULL_RTX)
+       {
+         gcc_assert (REG_P (rld[j].reg_rtx)
+                     && HARD_REGISTER_P (rld[j].reg_rtx));
+         reload_spill_index[j] = REGNO (rld[j].reg_rtx);
+       }
+      else
+       reload_spill_index[j] = -1;
 
       if (rld[j].nregs > 1)
        {

Reply via email to