This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Committed] S/390: Handle GOTOFF unspecs in delegitimize_address
- From: "Andreas Krebbel" <krebbel at linux dot vnet dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 18 Mar 2011 18:37:38 +0100
- Subject: [Committed] S/390: Handle GOTOFF unspecs in delegitimize_address
Hi,
the attached patch adds handling for GOTOFF unspecs to
delegitimize_address.
A lot of "note: non-delegitimized UNSPEC 112" messages disappear with
this. However not all of them.
Committed to mainline.
Bye,
-Andreas-
2011-03-18 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* config/s390/s390.c (s390_delegitimize_address): Handle GOTOFF
unspecs.
Index: gcc/config/s390/s390.c
===================================================================
*** gcc/config/s390/s390.c.orig
--- gcc/config/s390/s390.c
*************** s390_delegitimize_address (rtx orig_x)
*** 5015,5020 ****
--- 5015,5037 ----
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;