aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2001-12-12 10:10:56 -0800
committerRichard Henderson <rth@gcc.gnu.org>2001-12-12 10:10:56 -0800
commitd14419e437a6ae85159ffc6c5b04d092c7b1b63a (patch)
tree76a876c09c311488ac096f74c793c85b5a88894a
parent8cdfa312b4d4d0abdca7e9b9ecd4333568d40b83 (diff)
downloadgcc-d14419e437a6ae85159ffc6c5b04d092c7b1b63a.zip
gcc-d14419e437a6ae85159ffc6c5b04d092c7b1b63a.tar.gz
gcc-d14419e437a6ae85159ffc6c5b04d092c7b1b63a.tar.bz2
emit-rtl.c (adjust_address_1): Always copy address to avoid shared rtl.
* emit-rtl.c (adjust_address_1): Always copy address to avoid shared rtl. From-SVN: r47942
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/emit-rtl.c16
2 files changed, 14 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 319e07e..ed8c11b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2001-12-12 Richard Henderson <rth@redhat.com>
+
+ * emit-rtl.c (adjust_address_1): Always copy address to avoid
+ shared rtl.
+
Wed Dec 12 07:37:52 2001 Olivier Hainque <hainque@act-europe.fr>
* stmt.c (expand_end_case): Do subtraction of lower bound as trees
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 7c7dfd3..72886d1 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -1966,15 +1966,17 @@ adjust_address_1 (memref, mode, offset, validate, adjust)
rtx size = 0;
unsigned int memalign = MEM_ALIGN (memref);
- if (adjust == 0 || offset == 0)
- /* ??? Prefer to create garbage instead of creating shared rtl. */
- addr = copy_rtx (addr);
+ /* ??? Prefer to create garbage instead of creating shared rtl.
+ This may happen even if adjust is non-zero -- consider
+ (plus (plus reg reg) const_int) -- so do this always. */
+ addr = copy_rtx (addr);
+
/* If MEMREF is a LO_SUM and the offset is within the alignment of the
object, we can merge it into the LO_SUM. */
- else if (GET_MODE (memref) != BLKmode && GET_CODE (addr) == LO_SUM
- && offset >= 0
- && (unsigned HOST_WIDE_INT) offset
- < GET_MODE_ALIGNMENT (GET_MODE (memref)) / BITS_PER_UNIT)
+ if (GET_MODE (memref) != BLKmode && GET_CODE (addr) == LO_SUM
+ && offset >= 0
+ && (unsigned HOST_WIDE_INT) offset
+ < GET_MODE_ALIGNMENT (GET_MODE (memref)) / BITS_PER_UNIT)
addr = gen_rtx_LO_SUM (Pmode, XEXP (addr, 0),
plus_constant (XEXP (addr, 1), offset));
else