summaryrefslogtreecommitdiff
path: root/gcc/explow.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-03 19:44:20 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-03 19:44:20 +0000
commiteafc6604ee60b98aca48ea0cb212501416ec2def (patch)
tree081c8c15685a2597ef47710962db021ebdc66c2a /gcc/explow.c
parent9abd2cd79da82c4e0d0dfb36eb87ff600ace51df (diff)
downloadgcc-eafc6604ee60b98aca48ea0cb212501416ec2def.tar.gz
* explow.c (plus_constant_wide, case PLUS): Call find_constant_term
and avoid checking for constant as first operand. * recog.c (find_constant_term_loc): No longer static. (adj_offettable_operand): Delete. * rtl.h (adj_offsettable_operand): Delete declaration. (find_constant_term): Add declaration. * caller-save.c: Replace calls to adj_offsettable_operand with calls to adjust_address. * config/arm/arm.c, config/c4x/c4x.c: Likewise. * config/clipper/clipper.md, config/h8300/h8300.c: Likewise. * config/i386/i386.c, config/i386/i386.md: Likewise. * config/i860/i860.c, config/i960/i960.c: Likewise. * config/i960/i960.md, config/m68hc11/m68hc11.c: Likewise. * config/m68k/m68k.c, config/m68k/m68k.md: Likewise. * config/m88k/m88k.md, config/mcore/mcore.c: Likewise. * config/mips/mips.c, config/mips/mips.md: Likewise. * config/mn10200/mn10200.c, config/mn10300/mn10300.c: Likewise. * config/ns32k/ns32k.c, config/ns32k/ns32k.md: Likewise. * config/pa/pa.c, config/pdp11/pdp11.c: Likewise. * config/pdp11/pdp11.md, config/sh/sh.c, config/v850/v850.c: Likewise. * config/vax/vax.md, config/ns32k/ns32k.c: Likewise. * config/ns32k/ns32k.md: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43733 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/explow.c')
-rw-r--r--gcc/explow.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/gcc/explow.c b/gcc/explow.c
index a6a05f57cbf..bf5eb89622a 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -78,6 +78,7 @@ plus_constant_wide (x, c)
register HOST_WIDE_INT c;
{
register RTX_CODE code;
+ rtx y = x;
register enum machine_mode mode;
register rtx tem;
int all_constant = 0;
@@ -159,18 +160,20 @@ plus_constant_wide (x, c)
x = XEXP (x, 0);
goto restart;
}
- else if (CONSTANT_P (XEXP (x, 0)))
+ else if (CONSTANT_P (XEXP (x, 1)))
{
- x = gen_rtx_PLUS (mode,
- plus_constant (XEXP (x, 0), c),
- XEXP (x, 1));
+ x = gen_rtx_PLUS (mode, XEXP (x, 0), plus_constant (XEXP (x, 1), c));
c = 0;
}
- else if (CONSTANT_P (XEXP (x, 1)))
+ else if (find_constant_term_loc (&y))
{
- x = gen_rtx_PLUS (mode,
- XEXP (x, 0),
- plus_constant (XEXP (x, 1), c));
+ /* We need to be careful since X may be shared and we can't
+ modify it in place. */
+ rtx copy = copy_rtx (x);
+ rtx *const_loc = find_constant_term_loc (&copy);
+
+ *const_loc = plus_constant (*const_loc, c);
+ x = copy;
c = 0;
}
break;