]> gcc.gnu.org Git - gcc.git/commitdiff
(choose_reload_regs): Handle earlyclobbers
authorRichard Stallman <rms@gnu.org>
Fri, 21 May 1993 03:17:44 +0000 (03:17 +0000)
committerRichard Stallman <rms@gnu.org>
Fri, 21 May 1993 03:17:44 +0000 (03:17 +0000)
when inheriting from reg_last_reload_reg.

From-SVN: r4524

gcc/reload1.c

index 844a9e071a90161eb4da1993c599680631edb2e7..d5288070ba858d6864fa8d68851db2091955463b 100644 (file)
@@ -4820,18 +4820,40 @@ choose_reload_regs (insn, avoid_return_reg)
 
                      if (k == nr)
                        {
-                         /* Mark the register as in use for this part of
-                            the insn.  */
-                         mark_reload_reg_in_use (spill_regs[i],
-                                                 reload_opnum[r],
-                                                 reload_when_needed[r],
-                                                 reload_mode[r]);
-                         reload_reg_rtx[r] = reg_last_reload_reg[regno];
-                         reload_inherited[r] = 1;
-                         reload_inheritance_insn[r] = reg_reloaded_insn[i];
-                         reload_spill_index[r] = i;
-                         SET_HARD_REG_BIT (reload_reg_used_for_inherit,
-                                           spill_regs[i]);
+                         int i1;
+
+                         /* We found a register that contains the
+                            value we need.  If this register is the
+                            same as an `earlyclobber' operand of the
+                            current insn, just mark it as a place to
+                            reload from since we can't use it as the
+                            reload register itself.  */
+
+                         for (i1 = 0; i1 < n_earlyclobbers; i1++)
+                           if (reg_overlap_mentioned_for_reload_p
+                               (reg_last_reload_reg[regno],
+                                reload_earlyclobbers[i1]))
+                             break;
+
+                         if (i1 != n_earlyclobbers)
+                           reload_override_in[r] = reg_last_reload_reg[regno];
+                         else
+                           {
+                             /* We can use this as a reload reg.  */
+                             /* Mark the register as in use for this part of
+                                the insn.  */
+                             mark_reload_reg_in_use (spill_regs[i],
+                                                     reload_opnum[r],
+                                                     reload_when_needed[r],
+                                                     reload_mode[r]);
+                             reload_reg_rtx[r] = reg_last_reload_reg[regno];
+                             reload_inherited[r] = 1;
+                             reload_inheritance_insn[r]
+                               = reg_reloaded_insn[i];
+                             reload_spill_index[r] = i;
+                             SET_HARD_REG_BIT (reload_reg_used_for_inherit,
+                                               spill_regs[i]);
+                           }
                        }
                    }
                }
This page took 0.066739 seconds and 5 git commands to generate.