In reload, retain only those clobbers added for variable-array handling.
authorDale Johannesen <dalej@apple.com>
Thu, 5 Sep 2002 20:41:11 +0000 (20:41 +0000)
committerDale Johannesen <dalej@gcc.gnu.org>
Thu, 5 Sep 2002 20:41:11 +0000 (20:41 +0000)
From-SVN: r56863

gcc/ChangeLog
gcc/reload1.c

index 708503640b9feb5932f127b11b590bfd62cc1562..e2dd16a7741336727edfee8af428fd21161c5fcb 100644 (file)
@@ -1,3 +1,8 @@
+2002-09-05  Dale Johannesen  <dalej@apple.com>
+
+       * reload1.c (reload):  Retain only those memory clobbers
+       added for variable-array handling.
+
 2002-09-05  Jason Thorpe  <thorpej@wasabisystems.com>
 
        * config/arm/arm.c (arm_return_in_memory): Implement ATPCS
index c00426cf42013b1bd20ccdca2569cf547db9b1bc..a85d2507126133952934c1441ffef228d6d3b993 100644 (file)
@@ -1180,9 +1180,9 @@ reload (first, global)
 
   /* Make a pass over all the insns and delete all USEs which we inserted
      only to tag a REG_EQUAL note on them.  Remove all REG_DEAD and REG_UNUSED
-     notes.  Delete all CLOBBER insns that don't refer to the return value
-     or to memory (mem:BLK CLOBBERs must be retained to prevent the scheduler
-     from misarranging variable-array code) and simplify (subreg (reg))
+     notes.  Delete all CLOBBER insns, except those that refer to the return
+     value and the special mem:BLK CLOBBERs added to prevent the scheduler
+     from misarranging variable-array code, and simplify (subreg (reg))
      operands.  Also remove all REG_RETVAL and REG_LIBCALL notes since they
      are no longer useful or accurate.  Strip and regenerate REG_INC notes
      that may have been moved around.  */
@@ -1203,7 +1203,10 @@ reload (first, global)
                 || find_reg_note (insn, REG_EQUAL, NULL_RTX)))
            || (GET_CODE (PATTERN (insn)) == CLOBBER
                && (GET_CODE (XEXP (PATTERN (insn), 0)) != MEM
-                   || GET_MODE (XEXP (PATTERN (insn), 0)) != BLKmode)
+                   || GET_MODE (XEXP (PATTERN (insn), 0)) != BLKmode
+                   || (GET_CODE (XEXP (XEXP (PATTERN (insn), 0), 0)) != SCRATCH
+                       && XEXP (XEXP (PATTERN (insn), 0), 0) 
+                               != stack_pointer_rtx))
                && (GET_CODE (XEXP (PATTERN (insn), 0)) != REG
                    || ! REG_FUNCTION_VALUE_P (XEXP (PATTERN (insn), 0)))))
          {