emit-rtl.c (adjust_address, [...]): Handle an address that is a LO_SUM specially.

* 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.

From-SVN: r43866
This commit is contained in:
Richard Kenner 2001-07-09 18:56:00 +00:00 committed by Richard Kenner
parent 60a97cd4c4
commit 823e3574e6
3 changed files with 28 additions and 9 deletions

View File

@ -1,5 +1,9 @@
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.

View File

@ -1612,8 +1612,18 @@ adjust_address (memref, mode, offset)
{
/* 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. */
@ -1626,8 +1636,18 @@ adjust_address_nv (memref, mode, offset)
{
/* 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

View File

@ -180,11 +180,6 @@ plus_constant_wide (x, c)
}
break;
case LO_SUM:
return gen_rtx_LO_SUM (mode, XEXP (x, 0),
plus_constant (XEXP (x, 1), c));
default:
break;
}