]> gcc.gnu.org Git - gcc.git/commitdiff
jump.c (delete_computation): Don't assume that just becuase an instruction sets a...
authorMark Mitchell <mark@codesourcery.com>
Sun, 12 Nov 2000 13:01:37 +0000 (13:01 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Sun, 12 Nov 2000 13:01:37 +0000 (13:01 +0000)
* jump.c (delete_computation): Don't assume that just becuase an
instruction sets a register, that register is dead.

From-SVN: r37405

gcc/ChangeLog
gcc/jump.c
gcc/testsuite/gcc.c-torture/execute/20001112-1.c [new file with mode: 0644]

index b255253a79dc5134317c430b3301fdec951485ee..26e35f1ada06b473010b38f26b5aa2a33fbd6966 100644 (file)
@@ -1,3 +1,8 @@
+2000-11-12  Mark Mitchell  <mark@codesourcery.com>
+
+       * jump.c (delete_computation): Don't assume that just becuase an
+       instruction sets a register, that register is dead.
+
 2000-11-12  Neil Booth  <neilb@earthling.net>
 
         * cppexp.c: Don't worry about pfile->skipping.
index d6941c83ffa5a179781428410fa6f5fcfc635b7d..195e60f9d8b41e5e0776ef7fb7d321821c434332 100644 (file)
@@ -2680,7 +2680,6 @@ delete_computation (insn)
      rtx insn;
 {
   rtx note, next;
-  rtx set;
 
 #ifdef HAVE_cc0
   if (reg_referenced_p (cc0_rtx, PATTERN (insn)))
@@ -2717,32 +2716,6 @@ delete_computation (insn)
     }
 #endif
 
-  /* The REG_DEAD note may have been omitted for a register
-     which is both set and used by the insn.  */
-  set = single_set (insn);
-  if (set && GET_CODE (SET_DEST (set)) == REG)
-    {
-      int dest_regno = REGNO (SET_DEST (set));
-      int dest_endregno
-       = dest_regno + (dest_regno < FIRST_PSEUDO_REGISTER
-                       ? HARD_REGNO_NREGS (dest_regno,
-                                           GET_MODE (SET_DEST (set))) : 1);
-      int i;
-
-      for (i = dest_regno; i < dest_endregno; i++)
-       {
-         if (! refers_to_regno_p (i, i + 1, SET_SRC (set), NULL_PTR)
-             || find_regno_note (insn, REG_DEAD, i))
-           continue;
-
-         note = gen_rtx_EXPR_LIST (REG_DEAD,
-                                   (i < FIRST_PSEUDO_REGISTER
-                                    ? gen_rtx_REG (reg_raw_mode[i], i)
-                                    : SET_DEST (set)), NULL_RTX);
-         delete_prior_computation (note, insn);
-       }
-    }
-
   for (note = REG_NOTES (insn); note; note = next)
     {
       next = XEXP (note, 1);
diff --git a/gcc/testsuite/gcc.c-torture/execute/20001112-1.c b/gcc/testsuite/gcc.c-torture/execute/20001112-1.c
new file mode 100644 (file)
index 0000000..6ce2f66
--- /dev/null
@@ -0,0 +1,10 @@
+int main ()
+{
+  long long i = 1;
+
+  i = i * 2 + 1;
+  
+  if (i != 3)
+    abort ();
+  exit (0);
+}
This page took 0.084716 seconds and 5 git commands to generate.