Patchwork Fix PR bootstrap/48168

login
register
mail settings
Submitter Eric Botcazou
Date March 20, 2011, 9:46 p.m.
Message ID <201103202246.15142.ebotcazou@adacore.com>
Download mbox | patch
Permalink /patch/87675/
State New
Headers show

Comments

Eric Botcazou - March 20, 2011, 9:46 p.m.
This is the Ada bootstrap failure on SPARC caused by the recent VTA changes.
As on other platforms, the delegitimize_address routine needs to be enhanced.

Applied on the mainline.


2011-03-20  Eric Botcazou  <ebotcazou@adacore.com>

	PR bootstrap/48168
	* config/sparc/sparc.c (sparc_delegitimize_address): Add new pattern.

Patch

Index: config/sparc/sparc.c
===================================================================
--- config/sparc/sparc.c	(revision 171159)
+++ config/sparc/sparc.c	(working copy)
@@ -3661,6 +3661,18 @@  sparc_delegitimize_address (rtx x)
       gcc_assert (GET_CODE (x) == SYMBOL_REF);
     }
 
+  /* This is generated by mov{si,di}_pic_label_ref in PIC mode.  */
+  if (GET_CODE (x) == MINUS
+      && REG_P (XEXP (x, 0))
+      && REGNO (XEXP (x, 0)) == PIC_OFFSET_TABLE_REGNUM
+      && GET_CODE (XEXP (x, 1)) == LO_SUM
+      && GET_CODE (XEXP (XEXP (x, 1), 1)) == UNSPEC
+      && XINT (XEXP (XEXP (x, 1), 1), 1) == UNSPEC_MOVE_PIC_LABEL)
+    {
+      x = XVECEXP (XEXP (XEXP (x, 1), 1), 0, 0);
+      gcc_assert (GET_CODE (x) == LABEL_REF);
+    }
+
   return x;
 }