aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndreas Krebbel <Andreas.Krebbel@de.ibm.com>2011-03-18 17:32:29 +0000
committerAndreas Krebbel <krebbel@gcc.gnu.org>2011-03-18 17:32:29 +0000
commite101e12e593fdf3354221e5a02482238e9aad4a6 (patch)
treebba15375b980e8e9304e02734d377d9eef36f629 /gcc
parent4627c7fb2264f8c023865d4cd7b1abae9598ae11 (diff)
downloadgcc-e101e12e593fdf3354221e5a02482238e9aad4a6.zip
gcc-e101e12e593fdf3354221e5a02482238e9aad4a6.tar.gz
gcc-e101e12e593fdf3354221e5a02482238e9aad4a6.tar.bz2
s390.c (s390_delegitimize_address): Handle GOTOFF unspecs.
2011-03-18 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> * config/s390/s390.c (s390_delegitimize_address): Handle GOTOFF unspecs. From-SVN: r171157
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/s390/s390.c17
2 files changed, 22 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 519ba5d..4dda33c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2011-03-18 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+ * config/s390/s390.c (s390_delegitimize_address): Handle GOTOFF
+ unspecs.
+
+2011-03-18 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
* config/s390/s390.c (s390_chunkify_start): Prevent literal pool
splitting between a call and its corresponding CALL_ARG_LOCATION
note.
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index dcbd4ac..53083ae 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -5015,6 +5015,23 @@ s390_delegitimize_address (rtx orig_x)
orig_x = delegitimize_mem_from_attrs (orig_x);
x = orig_x;
+
+ /* Extract the symbol ref from:
+ (plus:SI (reg:SI 12 %r12)
+ (const:SI (unspec:SI [(symbol_ref/f:SI ("*.LC0"))]
+ UNSPEC_GOTOFF))) */
+ if (GET_CODE (x) == PLUS
+ && REG_P (XEXP (x, 0))
+ && REGNO (XEXP (x, 0)) == PIC_OFFSET_TABLE_REGNUM
+ && GET_CODE (XEXP (x, 1)) == CONST)
+ {
+ /* The const operand. */
+ y = XEXP (XEXP (x, 1), 0);
+ if (GET_CODE (y) == UNSPEC
+ && XINT (y, 1) == UNSPEC_GOTOFF)
+ return XVECEXP (y, 0, 0);
+ }
+
if (GET_CODE (x) != MEM)
return orig_x;