diff options
author | Andreas Krebbel <Andreas.Krebbel@de.ibm.com> | 2011-03-22 09:07:26 +0000 |
---|---|---|
committer | Andreas Krebbel <krebbel@gcc.gnu.org> | 2011-03-22 09:07:26 +0000 |
commit | ab081dd6234db09f2d8023f1f09777fc8cf10efb (patch) | |
tree | ad79e23636f85a26823bbfe93e73b5134ce8071b /gcc/config/s390 | |
parent | 6fd5332b45083b82b5f568906baa1aec743af386 (diff) | |
download | gcc-ab081dd6234db09f2d8023f1f09777fc8cf10efb.zip gcc-ab081dd6234db09f2d8023f1f09777fc8cf10efb.tar.gz gcc-ab081dd6234db09f2d8023f1f09777fc8cf10efb.tar.bz2 |
s390.c (s390_delegitimize_address): Fix offset handling for PLTOFF/GOTOFF.
2011-03-22 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* config/s390/s390.c (s390_delegitimize_address): Fix offset
handling for PLTOFF/GOTOFF.
From-SVN: r171281
Diffstat (limited to 'gcc/config/s390')
-rw-r--r-- | gcc/config/s390/s390.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 0501298..ab1005a 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -5030,17 +5030,22 @@ s390_delegitimize_address (rtx orig_x) && REGNO (XEXP (x, 0)) == PIC_OFFSET_TABLE_REGNUM && GET_CODE (XEXP (x, 1)) == CONST) { + HOST_WIDE_INT offset = 0; + /* The const operand. */ y = XEXP (XEXP (x, 1), 0); if (GET_CODE (y) == PLUS && GET_CODE (XEXP (y, 1)) == CONST_INT) - y = XEXP (y, 0); + { + offset = INTVAL (XEXP (y, 1)); + y = XEXP (y, 0); + } if (GET_CODE (y) == UNSPEC && (XINT (y, 1) == UNSPEC_GOTOFF || XINT (y, 1) == UNSPEC_PLTOFF)) - return XVECEXP (y, 0, 0); + return plus_constant (XVECEXP (y, 0, 0), offset); } if (GET_CODE (x) != MEM) |