Commit 4a78c787 by Richard Henderson Committed by Richard Henderson

emit-rtl.c (adjust_address_1): Don't adjust address if adjust is false.

        * emit-rtl.c (adjust_address_1): Don't adjust address if adjust
        is false.

From-SVN: r47978
parent 72dd53af
2001-12-13 Richard Henderson <rth@redhat.com>
* emit-rtl.c (adjust_address_1): Don't adjust address if adjust
is false.
2001-12-13 Richard Earnshaw <rearnsha@arm.com> 2001-12-13 Richard Earnshaw <rearnsha@arm.com>
* collect2.c (COLLECT_SHARED_INIT_FUNC) * collect2.c (COLLECT_SHARED_INIT_FUNC)
......
...@@ -1967,20 +1967,23 @@ adjust_address_1 (memref, mode, offset, validate, adjust) ...@@ -1967,20 +1967,23 @@ adjust_address_1 (memref, mode, offset, validate, adjust)
unsigned int memalign = MEM_ALIGN (memref); unsigned int memalign = MEM_ALIGN (memref);
/* ??? Prefer to create garbage instead of creating shared rtl. /* ??? 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. */ (plus (plus reg reg) const_int) -- so do this always. */
addr = copy_rtx (addr); addr = copy_rtx (addr);
/* If MEMREF is a LO_SUM and the offset is within the alignment of the if (adjust)
object, we can merge it into the LO_SUM. */ {
if (GET_MODE (memref) != BLKmode && GET_CODE (addr) == LO_SUM /* If MEMREF is a LO_SUM and the offset is within the alignment of the
&& offset >= 0 object, we can merge it into the LO_SUM. */
&& (unsigned HOST_WIDE_INT) offset if (GET_MODE (memref) != BLKmode && GET_CODE (addr) == LO_SUM
< GET_MODE_ALIGNMENT (GET_MODE (memref)) / BITS_PER_UNIT) && offset >= 0
addr = gen_rtx_LO_SUM (Pmode, XEXP (addr, 0), && (unsigned HOST_WIDE_INT) offset
plus_constant (XEXP (addr, 1), offset)); < GET_MODE_ALIGNMENT (GET_MODE (memref)) / BITS_PER_UNIT)
else addr = gen_rtx_LO_SUM (Pmode, XEXP (addr, 0),
addr = plus_constant (addr, offset); plus_constant (XEXP (addr, 1), offset));
else
addr = plus_constant (addr, offset);
}
new = change_address_1 (memref, mode, addr, validate); new = change_address_1 (memref, mode, addr, validate);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment