summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>2002-10-25 12:26:40 +0000
committeruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>2002-10-25 12:26:40 +0000
commita883bad84607870ea4bb741bce2eaa5fd249fcf9 (patch)
tree539cf5805f3ef36b9574279a41b1f9f11a6d68d9
parent43648826929d0084c0ef2cfe5376ec1a8917c252 (diff)
downloadppe42-gcc-a883bad84607870ea4bb741bce2eaa5fd249fcf9.tar.gz
ppe42-gcc-a883bad84607870ea4bb741bce2eaa5fd249fcf9.zip
* config/s390/s390.c (s390_decompose_address): Do not range check the
displacement if base or index is the argument pointer register. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58530 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/s390/s390.c16
2 files changed, 19 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0e26baf24f4..40518b357c4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2002-10-25 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.c (s390_decompose_address): Do not range check the
+ displacement if base or index is the argument pointer register.
+
2002-10-24 Hans-Peter Nilsson <hp@bitrange.com>
PR other/3337
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index f73f6aaa387..0f9c5a189f2 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -1597,8 +1597,20 @@ s390_decompose_address (addr, out)
/* Allow integer constant in range. */
if (GET_CODE (disp) == CONST_INT)
{
- if (INTVAL (disp) < 0 || INTVAL (disp) >= 4096)
- return FALSE;
+ /* If the argument pointer is involved, the displacement will change
+ later anyway as the argument pointer gets eliminated. This could
+ make a valid displacement invalid, but it is more likely to make
+ an invalid displacement valid, because we sometimes access the
+ register save area via negative offsets to the arg pointer.
+ Thus we don't check the displacement for validity here. If after
+ elimination the displacement turns out to be invalid after all,
+ this is fixed up by reload in any case. */
+ if ((base && REGNO (base) == ARG_POINTER_REGNUM)
+ || (indx && REGNO (indx) == ARG_POINTER_REGNUM))
+ ;
+
+ else if (INTVAL (disp) < 0 || INTVAL (disp) >= 4096)
+ return FALSE;
}
/* In the small-PIC case, the linker converts @GOT12
OpenPOWER on IntegriCloud