OSDN Git Service

* reload1.c (reload): Don't delete equiv insn if can throw.
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 8 Nov 2001 23:40:15 +0000 (23:40 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 8 Nov 2001 23:40:15 +0000 (23:40 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46866 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/reload1.c

index a718a8f..82ec7f9 100644 (file)
@@ -1,5 +1,7 @@
 Thu Nov  8 18:00:55 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
+       * reload1.c (reload): Don't delete equiv insn if can throw.
+
        * expr.c (emit_block_move): If X is readonly emit CLOBBER for it.
        (clear_storage): Likewise, for OBJECT.
 
index 165573b..ffc80de 100644 (file)
@@ -1071,9 +1071,16 @@ reload (first, global)
          for (list = reg_equiv_init[i]; list; list = XEXP (list, 1))
            {
              rtx equiv_insn = XEXP (list, 0);
-             if (GET_CODE (equiv_insn) == NOTE)
-               continue;
-             if (reg_set_p (regno_reg_rtx[i], PATTERN (equiv_insn)))
+
+             /* If we already deleted the insn or if it may trap, we can't
+                delete it.  The latter case shouldn't happen, but can
+                if an insn has a variable address, gets a REG_EH_REGION
+                note added to it, and then gets converted into an load
+                from a constant address.  */
+             if (GET_CODE (equiv_insn) == NOTE
+                 || can_throw_internal (equiv_insn))
+               ;
+             else if (reg_set_p (regno_reg_rtx[i], PATTERN (equiv_insn)))
                delete_dead_insn (equiv_insn);
              else
                {