summaryrefslogtreecommitdiff
path: root/gcc/emit-rtl.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2001-12-13 17:50:02 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2001-12-13 17:50:02 +0000
commitcd358719a2f0694c9ee124df888001005ad3121a (patch)
tree25855a02ec15bb86b5fc9eb76eceac385b393393 /gcc/emit-rtl.c
parent57a7edd3238964bc26bfea1b0ebd9aa013781fbb (diff)
downloadgcc-cd358719a2f0694c9ee124df888001005ad3121a.tar.gz
* emit-rtl.c (adjust_address_1): Don't adjust address if adjust
is false. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47978 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r--gcc/emit-rtl.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 72886d16a79..64a2624412d 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -1967,20 +1967,23 @@ adjust_address_1 (memref, mode, offset, validate, adjust)
unsigned int memalign = MEM_ALIGN (memref);
/* ??? Prefer to create garbage instead of creating shared rtl.
- This may happen even if adjust is non-zero -- consider
+ This may happen even if offset 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. */
- 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
- addr = plus_constant (addr, offset);
+ if (adjust)
+ {
+ /* If MEMREF is a LO_SUM and the offset is within the alignment of the
+ object, we can merge it into the LO_SUM. */
+ 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
+ addr = plus_constant (addr, offset);
+ }
new = change_address_1 (memref, mode, addr, validate);