aboutsummaryrefslogtreecommitdiff
path: root/gcc/reload1.c
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>1999-09-06 23:49:18 -0600
committerJeff Law <law@gcc.gnu.org>1999-09-06 23:49:18 -0600
commitc5c7673583c6310e7f8e45704fdc4aadff33e393 (patch)
treef1a67b6ea75a7f0da3f06e0a1c60b213f4403168 /gcc/reload1.c
parentad85216ece38be37dacbbb3fa7bb7db69aa33a4b (diff)
downloadgcc-c5c7673583c6310e7f8e45704fdc4aadff33e393.zip
gcc-c5c7673583c6310e7f8e45704fdc4aadff33e393.tar.gz
gcc-c5c7673583c6310e7f8e45704fdc4aadff33e393.tar.bz2
Merge in gcc2-ss-010999
From-SVN: r29150
Diffstat (limited to 'gcc/reload1.c')
-rw-r--r--gcc/reload1.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c
index a03e810..39421fa 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -463,7 +463,8 @@ init_reload ()
register rtx tem
= gen_rtx_MEM (Pmode,
gen_rtx_PLUS (Pmode,
- gen_rtx_REG (Pmode, LAST_VIRTUAL_REGISTER + 1),
+ gen_rtx_REG (Pmode,
+ LAST_VIRTUAL_REGISTER + 1),
GEN_INT (4)));
spill_indirect_levels = 0;
@@ -485,6 +486,7 @@ init_reload ()
tem = gen_rtx_PLUS (Pmode,
gen_rtx_REG (Pmode, HARD_FRAME_POINTER_REGNUM),
gen_rtx_REG (Pmode, i));
+
/* This way, we make sure that reg+reg is an offsettable address. */
tem = plus_constant (tem, 4);
@@ -2756,6 +2758,20 @@ eliminate_regs (x, mem_mode, insn)
mem_mode, insn);
return x;
+ /* You might think handling MINUS in a manner similar to PLUS is a
+ good idea. It is not. It has been tried multiple times and every
+ time the change has had to have been reverted.
+
+ Other parts of reload know a PLUS is special (gen_reload for example)
+ and require special code to handle code a reloaded PLUS operand.
+
+ Also consider backends where the flags register is clobbered by a
+ MINUS, but we can emit a PLUS that does not clobber flags (ia32,
+ lea instruction comes to mind). If we try to reload a MINUS, we
+ may kill the flags register that was holding a useful value.
+
+ So, please before trying to handle MINUS, consider reload as a
+ whole instead of this little section as well as the backend issues. */
case PLUS:
/* If this is the sum of an eliminable register and a constant, rework
the sum. */
@@ -2871,6 +2887,7 @@ eliminate_regs (x, mem_mode, insn)
case CALL:
case COMPARE:
+ /* See comments before PLUS about handling MINUS. */
case MINUS:
case DIV: case UDIV:
case MOD: case UMOD:
@@ -9208,6 +9225,7 @@ reload_cse_simplify_operands (insn)
case '#': case '&': case '!':
case '*': case '%':
case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
case 'm': case '<': case '>': case 'V': case 'o':
case 'E': case 'F': case 'G': case 'H':
case 's': case 'i': case 'n':