Generate REG_EQUAL notes when they'd be helpful
authorBernd Schmidt <bernds@redhat.co.uk>
Thu, 14 Sep 2000 16:45:42 +0000 (16:45 +0000)
committerBernd Schmidt <crux@gcc.gnu.org>
Thu, 14 Sep 2000 16:45:42 +0000 (16:45 +0000)
From-SVN: r36409

gcc/ChangeLog
gcc/local-alloc.c

index 6355ac14586007fd86abfad87cb90fcfefb2bc9b..ffa9e03fa7ad17cd4fd81a312076320ba1e0918c 100644 (file)
@@ -1,3 +1,10 @@
+2000-09-12  Bernd Schmidt  <bernds@redhat.co.uk>
+
+       From Joern Rennecke:
+       * local-alloc.c (update_equiv_regs): If there is no REG_EQUAL note
+       on an insn and function_invariant_p returns nonzero for the source,
+       add a REG_EQUAL note.
+
 Thu Sep 14 00:51:57 EDT 2000  John Wehle  (john@feith.com)
 
        * alias.c (memrefs_conflict_p): An ADDRESSOF doesn't
index 666faca1705e86a6ad235e07e5f68936b8693725..04b1613b68955ec935373a97017e39c26c217aab 100644 (file)
@@ -787,6 +787,13 @@ update_equiv_regs ()
 
       note = find_reg_note (insn, REG_EQUAL, NULL_RTX);
 
+      /* cse sometimes generates function invariants, but doesn't put a
+        REG_EQUAL note on the insn.  Since this note would be redundant,
+         there's no point creating it earlier than here.  */
+      if (! note && function_invariant_p (src))
+       REG_NOTES (insn)
+         = note = gen_rtx_EXPR_LIST (REG_EQUAL, src, REG_NOTES (insn));
+
       if (REG_N_SETS (regno) != 1
          && (! note
              || ! function_invariant_p (XEXP (note, 0))