diff options
author | Richard Kenner <kenner@vlsi1.ultra.nyu.edu> | 2001-07-03 19:44:20 +0000 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 2001-07-03 15:44:20 -0400 |
commit | b72f00afa4b3bea9d3475221a5f51decc7341159 (patch) | |
tree | 081c8c15685a2597ef47710962db021ebdc66c2a /gcc/explow.c | |
parent | 3b324340369b9c67e16382e949b63fb0cfeafaaa (diff) | |
download | gcc-b72f00afa4b3bea9d3475221a5f51decc7341159.zip gcc-b72f00afa4b3bea9d3475221a5f51decc7341159.tar.gz gcc-b72f00afa4b3bea9d3475221a5f51decc7341159.tar.bz2 |
explow.c (plus_constant_wide, case PLUS): Call find_constant_term and avoid checking for constant as first operand.
* 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.
From-SVN: r43733
Diffstat (limited to 'gcc/explow.c')
-rw-r--r-- | gcc/explow.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/gcc/explow.c b/gcc/explow.c index a6a05f5..bf5eb89 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 (©); + + *const_loc = plus_constant (*const_loc, c); + x = copy; c = 0; } break; |