]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
emit-rtl.c (set_unique_reg_note): Don't set a REG_EQUAL or REG_EQUIV note if multiple...
authorJohn Wehle <john@feith.com>
Wed, 5 Dec 2001 05:47:36 +0000 (05:47 +0000)
committerJohn Wehle <wehle@gcc.gnu.org>
Wed, 5 Dec 2001 05:47:36 +0000 (05:47 +0000)
* emit-rtl.c (set_unique_reg_note): Don't set
a REG_EQUAL or REG_EQUIV note if multiple sets
are present.

From-SVN: r47657

gcc/ChangeLog
gcc/emit-rtl.c

index 2dd1ca4856c08c866826d99fd4822d14ed622355..1eb92922f7049e260961c92cdbbe09e55b3afb96 100644 (file)
@@ -1,3 +1,9 @@
+Wed Dec  5 00:42:16 EST 2001  John Wehle  (john@feith.com)
+
+       * emit-rtl.c (set_unique_reg_note): Don't set
+       a REG_EQUAL or REG_EQUIV note if multiple sets
+       are present.
+
 2001-12-04  John David Anglin  <dave@hiauly1.hia.nrc.ca>
 
        * cfgrtl.c (verify_flow_info): Allow jump table data in fallthru if
index 3c2d8475598154a775f3f9fdbc14ff8fb938b160..6a30769cecb81ff24f6f6dc993f56a88c9968747 100644 (file)
@@ -4068,11 +4068,30 @@ set_unique_reg_note (insn, kind, datum)
 {
   rtx note = find_reg_note (insn, kind, NULL_RTX);
 
-  /* Don't add ASM_OPERAND REG_EQUAL/REG_EQUIV notes.
-     It serves no useful purpose and breaks eliminate_regs.  */
-  if ((kind == REG_EQUAL || kind == REG_EQUIV)
-      && GET_CODE (datum) == ASM_OPERANDS)
-    return NULL_RTX;
+  switch (kind)
+    {
+    case REG_EQUAL:
+    case REG_EQUIV:
+      /* Don't add REG_EQUAL/REG_EQUIV notes if the insn
+        has multiple sets (some callers assume single_set
+        means the insn only has one set, when in fact it
+        means the insn only has one * useful * set).  */
+      if (GET_CODE (PATTERN (insn)) == PARALLEL && multiple_sets (insn))
+       {
+         if (note)
+           abort ();
+         return NULL_RTX;
+       }
+
+      /* Don't add ASM_OPERAND REG_EQUAL/REG_EQUIV notes.
+        It serves no useful purpose and breaks eliminate_regs.  */
+      if (GET_CODE (datum) == ASM_OPERANDS)
+       return NULL_RTX;
+      break;
+
+    default:
+      break;
+    }
 
   if (note)
     {