Mon Jul 9 06:41:07 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+ * emit-rtl.c (adjust_address, adjust_address_nv): Handle an
+ address that is a LO_SUM specially.
+ * explow.c (plus_constant_wide, case LO_SUM): Deleted.
+
* c-lang.c (start_cdtor): Remove extra parameter from start_function.
* emit-rtl.c (adjust_address_nv, replace_equiv_address_nv): New fcns.
{
/* For now, this is just a wrapper for change_address, but eventually
will do memref tracking. */
- return
- change_address (memref, mode, plus_constant (XEXP (memref, 0), offset));
+ rtx addr = XEXP (memref, 0);
+
+ /* If MEMREF is a LO_SUM and the offset is within the size of the
+ object, we can merge it into the LO_SUM. */
+ if (GET_MODE (memref) != BLKmode && GET_CODE (addr) == LO_SUM
+ && offset >= 0 && offset < GET_MODE_SIZE (GET_MODE (memref)))
+ addr = gen_rtx_LO_SUM (mode, XEXP (addr, 0),
+ plus_constant (XEXP (addr, 1), offset));
+ else
+ addr = plus_constant (addr, offset);
+
+ return change_address (memref, mode, addr);
}
/* Likewise, but the reference is not required to be valid. */
{
/* For now, this is just a wrapper for change_address, but eventually
will do memref tracking. */
- return change_address_1 (memref, mode,
- plus_constant (XEXP (memref, 0), offset), 0);
+ rtx addr = XEXP (memref, 0);
+
+ /* If MEMREF is a LO_SUM and the offset is within the size of the
+ object, we can merge it into the LO_SUM. */
+ if (GET_MODE (memref) != BLKmode && GET_CODE (addr) == LO_SUM
+ && offset >= 0 && offset < GET_MODE_SIZE (GET_MODE (memref)))
+ addr = gen_rtx_LO_SUM (mode, XEXP (addr, 0),
+ plus_constant (XEXP (addr, 1), offset));
+ else
+ addr = plus_constant (addr, offset);
+
+ return change_address_1 (memref, mode, addr, 0);
}
/* Return a memory reference like MEMREF, but with its address changed to