diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2012-07-13 08:53:24 +0000 |
---|---|---|
committer | Hans-Peter Nilsson <hp@gcc.gnu.org> | 2012-07-13 08:53:24 +0000 |
commit | b1435931f280564bd885cf17f84ea3ea2ef90826 (patch) | |
tree | 8b7582506377af4314c53d0965ff8ca5db4ec85f /gcc/df-problems.c | |
parent | a2faea4bdada3f2ce99afb15dcf55770c8f8ed92 (diff) | |
download | gcc-b1435931f280564bd885cf17f84ea3ea2ef90826.zip gcc-b1435931f280564bd885cf17f84ea3ea2ef90826.tar.gz gcc-b1435931f280564bd885cf17f84ea3ea2ef90826.tar.bz2 |
re PR rtl-optimization/53908 (csa removes needed memory load)
PR rtl-optimization/53908
* df-problems.c (can_move_insns_across): When doing
memory-reference book-keeping, handle call insns.
Co-Authored-By: Bernd Schmidt <bernds@codesourcery.com>
Co-Authored-By: Steven Bosscher <steven@gcc.gnu.org>
From-SVN: r189454
Diffstat (limited to 'gcc/df-problems.c')
-rw-r--r-- | gcc/df-problems.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/df-problems.c b/gcc/df-problems.c index 7afbed9..d650d0b 100644 --- a/gcc/df-problems.c +++ b/gcc/df-problems.c @@ -4068,6 +4068,19 @@ can_move_insns_across (rtx from, rtx to, rtx across_from, rtx across_to, for (insn = across_to; ; insn = next) { + if (CALL_P (insn)) + { + if (RTL_CONST_OR_PURE_CALL_P (insn)) + /* Pure functions can read from memory. Const functions can + read from arguments that the ABI has forced onto the stack. + Neither sort of read can be volatile. */ + memrefs_in_across |= MEMREF_NORMAL; + else + { + memrefs_in_across |= MEMREF_VOLATILE; + mem_sets_in_across |= MEMREF_VOLATILE; + } + } if (NONDEBUG_INSN_P (insn)) { memrefs_in_across |= for_each_rtx (&PATTERN (insn), find_memory, |