(reload_reg_free_p, case RELOAD_OTHER): Allowed to conflict with
authorRichard Kenner <kenner@gcc.gnu.org>
Thu, 16 Jun 1994 22:54:00 +0000 (18:54 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Thu, 16 Jun 1994 22:54:00 +0000 (18:54 -0400)
RELOAD_FOR_OTHER_ADDRESS.

From-SVN: r7505

gcc/reload1.c

index 6de6b1d4ff05327ad6ce949c054488bccf4fe197..11e0a1bf4a66ffe57dfddb3b405b6a79c51fd7e7 100644 (file)
@@ -4156,10 +4156,22 @@ reload_reg_free_p (regno, opnum, type)
   switch (type)
     {
     case RELOAD_OTHER:
-      /* In use for anything means not available for a RELOAD_OTHER.  */
-      return ! TEST_HARD_REG_BIT (reload_reg_used_at_all, regno);
+      /* In use for anything except RELOAD_FOR_OTHER_ADDRESS means
+        we can't use it for RELOAD_OTHER.  */
+      if (TEST_HARD_REG_BIT (reload_reg_used, regno)
+         || TEST_HARD_REG_BIT (reload_reg_used_in_op_addr, regno)
+         || TEST_HARD_REG_BIT (reload_reg_used_in_insn, regno))
+       return 0;
+
+      for (i = 0; i < reload_n_operands; i++)
+       if (TEST_HARD_REG_BIT (reload_reg_used_in_input_addr[i], regno)
+           || TEST_HARD_REG_BIT (reload_reg_used_in_output_addr[i], regno)
+           || TEST_HARD_REG_BIT (reload_reg_used_in_input[i], regno)
+           || TEST_HARD_REG_BIT (reload_reg_used_in_output[i], regno))
+         return 0;
+
+      return 1;
 
-      /* The other kinds of use can sometimes share a register.  */
     case RELOAD_FOR_INPUT:
       if (TEST_HARD_REG_BIT (reload_reg_used_in_insn, regno)
          || TEST_HARD_REG_BIT (reload_reg_used_in_op_addr, regno))