]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/53908 (csa removes needed memory load)
authorRichard Sandiford <rdsandiford@googlemail.com>
Fri, 13 Jul 2012 08:53:24 +0000 (08:53 +0000)
committerHans-Peter Nilsson <hp@gcc.gnu.org>
Fri, 13 Jul 2012 08:53:24 +0000 (08:53 +0000)
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

gcc/ChangeLog
gcc/df-problems.c

index 1415b3837d4ffd590f803b6aaf2757aa2cc291af..3bce65cc00441df7722e7eb3cc45398f6b4c61a0 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-13  Richard Guenther  <rguenther@suse.de>
 
        * gimple.c (gimple_types_compatible_p_1): Remove redundant
index 7afbed982833ab84d74603ce797d5161c91627de..d650d0ba4151c6bfc8dbf170b804097bdb3a56f7 100644 (file)
@@ -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,