OSDN Git Service

PR rtl-optimization/53908
authorhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 13 Jul 2012 17:21:41 +0000 (17:21 +0000)
committerhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 13 Jul 2012 17:21:41 +0000 (17:21 +0000)
* 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/branches/gcc-4_7-branch@189468 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/df-problems.c

index a15cf45..a2df227 100644 (file)
@@ -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-10  Uros Bizjak  <ubizjak@gmail.com>
 
        Backport from mainline
index c9fc91b..4afdd6f 100644 (file)
@@ -3961,6 +3961,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,