combine.c (distribute_notes): Don't delete sets to global register variables.
authorEric Christopher <echristo@redhat.com>
Thu, 24 Jun 2004 19:15:43 +0000 (19:15 +0000)
committerEric Christopher <echristo@gcc.gnu.org>
Thu, 24 Jun 2004 19:15:43 +0000 (19:15 +0000)
2004-06-24  Eric Christopher  <echristo@redhat.com>

* combine.c (distribute_notes): Don't delete sets to
global register variables.

From-SVN: r83606

gcc/ChangeLog
gcc/combine.c

index 7799244f09cf60e6f0df683c4b9da5d029051ba8..a08ab3f5d6ab51a617148379ac9a58a25b9082de 100644 (file)
@@ -1,3 +1,8 @@
+2004-06-24  Eric Christopher  <echristo@redhat.com>
+
+       * combine.c (distribute_notes): Don't delete sets to
+       global register variables.
+
 2004-06-24  Jakub Jelinek  <jakub@redhat.com>
 
        * config/i386/i386.md (ffsdi2, clzdi2): New expanders.
index c0fef9d7f38a1d8fabc6a9e1bae1c60dc785ed66..008e351ca1a561f2d1231892fc884b75fd5f1d86 100644 (file)
@@ -11821,8 +11821,10 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2)
 
                  /* If the register is being set at TEM, see if that is all
                     TEM is doing.  If so, delete TEM.  Otherwise, make this
-                    into a REG_UNUSED note instead.  */
-                 if (reg_set_p (XEXP (note, 0), PATTERN (tem)))
+                    into a REG_UNUSED note instead. Don't delete sets to
+                    global register vars.  */
+                 if (reg_set_p (XEXP (note, 0), PATTERN (tem))
+                     && !global_regs [REGNO(XEXP (note, 0))])
                    {
                      rtx set = single_set (tem);
                      rtx inner_dest = 0;