aboutsummaryrefslogtreecommitdiff
path: root/gcc/reload.c
diff options
context:
space:
mode:
authorRichard Earnshaw <rearnsha@arm.com>2012-09-14 17:02:04 +0000
committerRichard Earnshaw <rearnsha@gcc.gnu.org>2012-09-14 17:02:04 +0000
commit57132d23faff3f5e18d4773892070763bf6a89ca (patch)
tree669ec75fa8e27dc3bc1599c04d8fd597458e27c8 /gcc/reload.c
parenta27d595da25b497f14d8f3714b63819f712cde11 (diff)
downloadgcc-57132d23faff3f5e18d4773892070763bf6a89ca.zip
gcc-57132d23faff3f5e18d4773892070763bf6a89ca.tar.gz
gcc-57132d23faff3f5e18d4773892070763bf6a89ca.tar.bz2
reload.c (find_dummy_reload): Don't use OUT as a reload reg for IN if it overlaps a fixed register.
* reload.c (find_dummy_reload): Don't use OUT as a reload reg for IN if it overlaps a fixed register. From-SVN: r191305
Diffstat (limited to 'gcc/reload.c')
-rw-r--r--gcc/reload.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/reload.c b/gcc/reload.c
index f4f3ed0..2e41ed6 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -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)