]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/54516 (ICE in reload_cse_simplify_operands, at postreload.c:403 with...
authorRichard Earnshaw <rearnsha@arm.com>
Fri, 14 Sep 2012 17:10:45 +0000 (17:10 +0000)
committerRichard Earnshaw <rearnsha@gcc.gnu.org>
Fri, 14 Sep 2012 17:10:45 +0000 (17:10 +0000)
PR target/54516
PR rtl-optimization/54540
* reload.c (find_dummy_reload): Don't use OUT as a reload reg
for IN if it overlaps a fixed register.

From-SVN: r191307

gcc/ChangeLog
gcc/reload.c

index 847b12089d97379d2ec41d162768e7139f57dbe3..21a8f94e22fc3202a8984ff9cd15f9fb686c9d92 100644 (file)
@@ -1,3 +1,10 @@
+2012-09-14  Richard Earnshaw  <rearnsha@arm.com>
+
+       PR target/54516
+       PR rtl-optimization/54540
+       * reload.c (find_dummy_reload): Don't use OUT as a reload reg
+       for IN if it overlaps a fixed register.
+
 2012-09-14  Eric Botcazou  <ebotcazou@adacore.com>
 
        PR rtl-optimization/44194
index f4f3ed03d859fb59a251cc3bfc32fe592d041b2d..2e41ed6498e6a394dc01c6c4ed3d1f6df6da6ec6 100644 (file)
@@ -2036,7 +2036,12 @@ find_dummy_reload (rtx real_in, rtx real_out, rtx *inloc, rtx *outloc,
         However, we only ignore IN in its role as this reload.
         If the insn uses IN elsewhere and it contains OUT,
         that counts.  We can't be sure it's the "same" operand
-        so it might not go through this reload.  */
+        so it might not go through this reload.  
+
+         We also need to avoid using OUT if it, or part of it, is a
+         fixed register.  Modifying such registers, even transiently,
+         may have undefined effects on the machine, such as modifying
+         the stack pointer.  */
       saved_rtx = *inloc;
       *inloc = const0_rtx;
 
@@ -2049,7 +2054,8 @@ find_dummy_reload (rtx real_in, rtx real_out, rtx *inloc, rtx *outloc,
 
          for (i = 0; i < nwords; i++)
            if (! TEST_HARD_REG_BIT (reg_class_contents[(int) rclass],
-                                    regno + i))
+                                    regno + i)
+               || fixed_regs[regno + i])
              break;
 
          if (i == nwords)