diff options
author | hp <hp@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-07-13 08:53:24 +0000 |
---|---|---|
committer | hp <hp@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-07-13 08:53:24 +0000 |
commit | cd734582c151824710104daceb0cd266ea3d2944 (patch) | |
tree | 8b7582506377af4314c53d0965ff8ca5db4ec85f | |
parent | ca675b2e5e8560c243e88fe54c7d2e5fa3c288d6 (diff) | |
download | gcc-cd734582c151824710104daceb0cd266ea3d2944.tar.gz |
PR rtl-optimization/53908
* df-problems.c (can_move_insns_across): When doing
memory-reference book-keeping, handle call insns.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@189454 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/df-problems.c | 13 |
2 files changed, 21 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1415b3837d4..3bce65cc004 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2012-07-13 Richard Sandiford <rdsandiford@googlemail.com> + Steven Bosscher <steven@gcc.gnu.org> + Bernd Schmidt <bernds@codesourcery.com> + + PR rtl-optimization/53908 + * df-problems.c (can_move_insns_across): When doing + memory-reference book-keeping, handle call insns. + 2012-07-13 Richard Guenther <rguenther@suse.de> * gimple.c (gimple_types_compatible_p_1): Remove redundant diff --git a/gcc/df-problems.c b/gcc/df-problems.c index 7afbed98283..d650d0ba415 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, |