]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/22509 (elemental.f90 testsuite failure (-fweb))
authorZdenek Dvorak <dvorakz@suse.cz>
Fri, 11 Nov 2005 13:38:07 +0000 (14:38 +0100)
committerZdenek Dvorak <rakdver@gcc.gnu.org>
Fri, 11 Nov 2005 13:38:07 +0000 (13:38 +0000)
PR rtl-optimization/22509
* local-alloc.c (memref_used_between_p): Check whether a function call
could not reference the memref.

From-SVN: r106783

gcc/ChangeLog
gcc/local-alloc.c

index 0337eb217f03ecca86af7196a0aecb1cd177a9ad..c9f0917d50b15f77a525c45b5a83e52ba9dba9dd 100644 (file)
@@ -1,3 +1,9 @@
+2005-11-11  Zdenek Dvorak  <dvorakz@suse.cz>
+
+       PR rtl-optimization/22509
+       * local-alloc.c (memref_used_between_p): Check whether a function call
+       could not reference the memref.
+
 2005-11-11  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * postreload.c (reload_cse_simplify_operands): Fix bug in sorting
index 4ee4991d0cd5b8a6007ca6113c7beee91571466f..0380ff974e7a66da22295582dc76a1e98c80c91a 100644 (file)
@@ -762,8 +762,19 @@ memref_used_between_p (rtx memref, rtx start, rtx end)
 
   for (insn = NEXT_INSN (start); insn != NEXT_INSN (end);
        insn = NEXT_INSN (insn))
-    if (INSN_P (insn) && memref_referenced_p (memref, PATTERN (insn)))
-      return 1;
+    {
+      if (!INSN_P (insn))
+       continue;
+      
+      if (memref_referenced_p (memref, PATTERN (insn)))
+       return 1;
+
+      /* Nonconst functions may access memory.  */
+      if (CALL_P (insn)
+         && (! CONST_OR_PURE_CALL_P (insn)
+             || pure_call_p (insn)))
+       return 1;
+    }
 
   return 0;
 }