summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-09 18:56:00 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-09 18:56:00 +0000
commitfb257ae65f3d3ded271e0b700ea585650922fc94 (patch)
treed13565676d9fd2c3a4a8cf406c20a5d7144cffe7 /gcc
parent54cbd558bd78fe99d1abb6804da03255935c4bda (diff)
downloadgcc-fb257ae65f3d3ded271e0b700ea585650922fc94.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43866 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/emit-rtl.c28
-rw-r--r--gcc/explow.c5
3 files changed, 28 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6a0bbc41780..18539e6cc27 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 3a96906424e..4187468538d 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -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
diff --git a/gcc/explow.c b/gcc/explow.c
index f7e00be1ce9..cafbf2e2afa 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -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;
}