s390.c (s390_decompose_address): Do not range check the displacement if base or index...
authorUlrich Weigand <uweigand@de.ibm.com>
Fri, 25 Oct 2002 12:26:40 +0000 (12:26 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Fri, 25 Oct 2002 12:26:40 +0000 (12:26 +0000)
* config/s390/s390.c (s390_decompose_address): Do not range check the
displacement if base or index is the argument pointer register.

From-SVN: r58530

gcc/ChangeLog
gcc/config/s390/s390.c

index 0e26baf24f476941fa3aedc8e2e1569ef44ccd8a..40518b357c4101200d8977ead1f91faa72d2554d 100644 (file)
@@ -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
index f73f6aaa387fc5c9ab92f9c19cf7ea7e809dd6c0..0f9c5a189f290c725cf91b582dc7912adfb84a44 100644 (file)
@@ -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