OSDN Git Service

* reload1.c (reload_combine_note_use): Handle return register USEs.
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 3 Mar 2000 14:20:28 +0000 (14:20 +0000)
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 3 Mar 2000 14:20:28 +0000 (14:20 +0000)
REG case: Handle multi-hard-register hard regs.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32310 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/reload1.c

index 2517dcb..1d51311 100644 (file)
@@ -1,3 +1,8 @@
+Fri Mar  3 12:49:28 2000  J"orn Rennecke <amylaar@cygnus.co.uk>
+
+       * reload1.c (reload_combine_note_use): Handle return register USEs.
+       REG case: Handle multi-hard-register hard regs.
+
 Fri Mar  3 07:38:34 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
        * md.texi: Document use of '*' in insn pattern name.
index c4fe640..e91cf6f 100644 (file)
@@ -9253,6 +9253,21 @@ reload_combine_note_use (xp, insn)
        }
       break;
 
+    case USE:
+      /* If this is the USE of a return value, we can't change it.  */
+      if (GET_CODE (XEXP (x, 0)) == REG && REG_FUNCTION_VALUE_P (XEXP (x, 0)))
+       {
+       /* Mark the return register as used in an unknown fashion.  */
+         rtx reg = XEXP (x, 0);
+         int regno = REGNO (reg);
+         int nregs = HARD_REGNO_NREGS (regno, GET_MODE (reg));
+
+         while (--nregs >= 0)
+           reg_state[regno + nregs].use_index = -1;
+         return;
+       }
+      break;
+
     case CLOBBER:
       if (GET_CODE (SET_DEST (x)) == REG)
        return;
@@ -9269,12 +9284,23 @@ reload_combine_note_use (xp, insn)
       {
        int regno = REGNO (x);
        int use_index;
+       int nregs;
 
        /* Some spurious USEs of pseudo registers might remain.
           Just ignore them.  */
        if (regno >= FIRST_PSEUDO_REGISTER)
          return;
 
+       nregs = HARD_REGNO_NREGS (regno, GET_MODE (x));
+
+       /* We can't substitute into multi-hard-reg uses.  */
+       if (nregs > 1)
+         {
+           while (--nregs >= 0)
+             reg_state[regno + nregs].use_index = -1;
+           return;
+         }
+
        /* If this register is already used in some unknown fashion, we
           can't do anything.
           If we decrement the index from zero to -1, we can't store more