From c52ba957b5235c6e85a958f2d20d3c12f96fc5a5 Mon Sep 17 00:00:00 2001 From: rakdver Date: Fri, 11 Nov 2005 13:38:07 +0000 Subject: PR rtl-optimization/22509 * local-alloc.c (memref_used_between_p): Check whether a function call could not reference the memref. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@106783 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/local-alloc.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'gcc/local-alloc.c') diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c index 4ee4991d0cd..0380ff974e7 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; } -- cgit v1.2.1