aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Evans <dje@gnu.org>1997-02-19 00:40:42 +0000
committerDoug Evans <dje@gnu.org>1997-02-19 00:40:42 +0000
commit930aeef3f3963cd1660a217e8f43ce04efd5d678 (patch)
treef8af545a13cbc101ca6967d8cbb9534b2e1823ce
parentf302eea3892031ac184e7712e25d61ae7b59609d (diff)
downloadgcc-930aeef3f3963cd1660a217e8f43ce04efd5d678.zip
gcc-930aeef3f3963cd1660a217e8f43ce04efd5d678.tar.gz
gcc-930aeef3f3963cd1660a217e8f43ce04efd5d678.tar.bz2
reload1.c (eliminate_regs, case MINUS): Canonicalize (minus (plus reg const) reg) to (plus (minus reg reg) const).
* reload1.c (eliminate_regs, case MINUS): Canonicalize (minus (plus reg const) reg) to (plus (minus reg reg) const). Back out this patch. From-SVN: r13664
-rw-r--r--gcc/reload1.c25
1 files changed, 2 insertions, 23 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 780fc1f..591f489 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -2873,7 +2873,7 @@ eliminate_regs (x, mem_mode, insn)
context.
If we have (plus (eliminable) (reg)), we want to produce
- (plus (plus (replacement) (reg)) (const)). If this was part of a
+ (plus (plus (replacement) (reg) (const))). If this was part of a
normal add insn, (plus (replacement) (reg)) will be pushed as a
reload. This is the desired action. */
@@ -2912,28 +2912,6 @@ eliminate_regs (x, mem_mode, insn)
}
return x;
- case MINUS:
- /* If we have (minus (eliminable) (reg)), we want to produce
- (plus (minus (replacement) (reg)) (const)). The main reason being
- to be consistent with what is done for PLUS. find_reloads_address
- assumes that we do this. */
- {
- rtx new0 = eliminate_regs (XEXP (x, 0), mem_mode, insn);
- rtx new1 = eliminate_regs (XEXP (x, 1), mem_mode, insn);
-
- if (new0 != XEXP (x, 0) || new1 != XEXP (x, 1))
- {
- if (GET_CODE (new0) == PLUS)
- return gen_rtx (PLUS, GET_MODE (x),
- gen_rtx (MINUS, GET_MODE (x),
- XEXP (new0, 0), new1),
- XEXP (new0, 1));
- else
- return gen_rtx (MINUS, GET_MODE (x), new0, new1);
- }
- }
- return x;
-
case MULT:
/* If this is the product of an eliminable register and a
constant, apply the distribute law and move the constant out
@@ -2962,6 +2940,7 @@ eliminate_regs (x, mem_mode, insn)
case CALL:
case COMPARE:
+ case MINUS:
case DIV: case UDIV:
case MOD: case UMOD:
case AND: case IOR: case XOR: