ira.c (validate_equiv_mem): Remove code to avoid invalidation of readonly memory...
authorJeff Law <law@redhat.com>
Thu, 4 Nov 2010 13:15:33 +0000 (07:15 -0600)
committerJeff Law <law@gcc.gnu.org>
Thu, 4 Nov 2010 13:15:33 +0000 (07:15 -0600)
* ira.c (validate_equiv_mem): Remove code to avoid invalidation
of readonly memory equivalances for const/pure calls.

From-SVN: r166309

gcc/ChangeLog
gcc/ira.c

index a2e1cc88391b6a2b2874f9f344e25e2ef75d3999..c5fe9b290bd05486211430e68e78d585930586fb 100644 (file)
@@ -1,3 +1,8 @@
+2010-11-04  Jeff Law  <law@redhat.com>
+
+       * ira.c (validate_equiv_mem): Remove code to avoid invalidation
+       of readonly memory equivalances for const/pure calls.
+
 2010-11-04  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/45733
index e84230e1c3e3fc41b00e8d0c447c599139d0a85f..d37247f55b12fac57c146d06b97744efcddc8de1 100644 (file)
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -1915,8 +1915,12 @@ validate_equiv_mem (rtx start, rtx reg, rtx memref)
       if (find_reg_note (insn, REG_DEAD, reg))
        return 1;
 
-      if (CALL_P (insn) && ! MEM_READONLY_P (memref)
-         && ! RTL_CONST_OR_PURE_CALL_P (insn))
+      /* This used to ignore readonly memory and const/pure calls.  The problem
+        is the equivalent form may reference a pseudo which gets assigned a
+        call clobbered hard reg.  When we later replace REG with its
+        equivalent form, the value in the call-clobbered reg has been
+        changed and all hell breaks loose.  */
+      if (CALL_P (insn))
        return 0;
 
       note_stores (PATTERN (insn), validate_equiv_mem_from_store, NULL);