Patch for asm clobber of fp.
authorJames E Wilson <wilson@specifixinc.com>
Sat, 20 Dec 2003 02:39:43 +0000 (02:39 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Sat, 20 Dec 2003 02:39:43 +0000 (18:39 -0800)
* flow.c (mark_set_regs, case PARALLEL): Scan loop forwards.
Add case for ASM_OPERANDS.
* global.c (global_alloc): Set regs_ever_live for regs_asm_clobbered
registers.

From-SVN: r74869

gcc/ChangeLog
gcc/flow.c
gcc/global.c

index 5528fd7fdefcdc6743905b9877af35025cb7ed34..eea65d3f8d7096aad1f44f75cb4ba3696460ca70 100644 (file)
@@ -1,3 +1,10 @@
+2003-12-19  James E Wilson  <wilson@specifixinc.com>
+
+       * flow.c (mark_set_regs, case PARALLEL): Scan loop forwards.
+       Add case for ASM_OPERANDS.
+       * global.c (global_alloc): Set regs_ever_live for regs_asm_clobbered
+       registers.
+
 2003-12-19  Kazu Hirata  <kazu@cs.umass.edu>
 
        * expr.c (check_max_integer_computation_mode): Remove.
index 023fb1c83500e24467ff3d76b6a37592ffb1f3fe..c146310cb0a902b4b2cc35709cd1d3c17270355c 100644 (file)
@@ -2468,7 +2468,9 @@ mark_set_regs (struct propagate_block_info *pbi, rtx x, rtx insn)
       {
        int i;
 
-       for (i = XVECLEN (x, 0) - 1; i >= 0; i--)
+       /* We must scan forwards.  If we have an asm, we need to set
+          the PROP_ASM_SCAN flag before scanning the clobbers.  */
+       for (i = 0; i < XVECLEN (x, 0); i++)
          {
            rtx sub = XVECEXP (x, 0, i);
            switch (code = GET_CODE (sub))
@@ -2495,6 +2497,10 @@ mark_set_regs (struct propagate_block_info *pbi, rtx x, rtx insn)
                mark_set_1 (pbi, code, SET_DEST (sub), cond, insn, flags);
                break;
 
+             case ASM_OPERANDS:
+               flags |= PROP_ASM_SCAN;
+               break;
+
              default:
                break;
              }
index d19e87e5ed99ab3faba5d32f01f5eeef033bd61c..de765b36731e24a0d4a59c52b21e01f17f0b58d2 100644 (file)
@@ -355,6 +355,8 @@ global_alloc (FILE *file)
       else if (cannot_elim)
        error ("%s cannot be used in asm here",
               reg_names[eliminables[i].from]);
+      else
+       regs_ever_live[eliminables[i].from] = 1;
     }
 #if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
   if (!regs_asm_clobbered[HARD_FRAME_POINTER_REGNUM])
@@ -366,6 +368,8 @@ global_alloc (FILE *file)
   else if (need_fp)
     error ("%s cannot be used in asm here",
           reg_names[HARD_FRAME_POINTER_REGNUM]);
+  else
+    regs_ever_live[HARD_FRAME_POINTER_REGNUM] = 1;
 #endif
 
 #else
@@ -377,6 +381,8 @@ global_alloc (FILE *file)
     }
   else if (need_fp)
     error ("%s cannot be used in asm here", reg_names[FRAME_POINTER_REGNUM]);
+  else
+    regs_ever_live[FRAME_POINTER_REGNUM] = 1;
 #endif
 
   /* Track which registers have already been used.  Start with registers