From: Zdenek Dvorak Date: Fri, 11 Nov 2005 13:38:07 +0000 (+0100) Subject: re PR rtl-optimization/22509 (elemental.f90 testsuite failure (-fweb)) X-Git-Tag: releases/gcc-4.1.0~932 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=301a8f9577f730dcb680760b84e258e62cafd01f;p=thirdparty%2Fgcc.git re PR rtl-optimization/22509 (elemental.f90 testsuite failure (-fweb)) PR rtl-optimization/22509 * local-alloc.c (memref_used_between_p): Check whether a function call could not reference the memref. From-SVN: r106783 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0337eb217f03..c9f0917d50b1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-11-11 Zdenek Dvorak + + 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 * postreload.c (reload_cse_simplify_operands): Fix bug in sorting diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c index 4ee4991d0cd5..0380ff974e7a 100644 --- a/gcc/local-alloc.c +++ b/gcc/local-alloc.c @@ -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; }