Patchwork [SPARC] Add another pattern to sparc_delegitimize_address

login
register
mail settings
Submitter Eric Botcazou
Date May 22, 2011, 8:12 p.m.
Message ID <201105222212.38213.ebotcazou@adacore.com>
Download mbox | patch
Permalink /patch/96771/
State New
Headers show

Comments

Eric Botcazou - May 22, 2011, 8:12 p.m.
In preparation for another change.

Bootstrapped/regtested on SPARC/Solaris and SPARC64/Solaris, applied on the 
mainline.


2011-05-22  Eric Botcazou  <ebotcazou@adacore.com>

	* config/sparc/sparc.c (sparc_delegitimize_address): Handle
	UNSPEC_MOVE_PIC pattern.

Patch

Index: config/sparc/sparc.c
===================================================================
--- config/sparc/sparc.c	(revision 174016)
+++ config/sparc/sparc.c	(working copy)
@@ -3615,13 +3615,17 @@  sparc_delegitimize_address (rtx x)
 {
   x = delegitimize_mem_from_attrs (x);
 
-  if (GET_CODE (x) == LO_SUM
-      && GET_CODE (XEXP (x, 1)) == UNSPEC
-      && XINT (XEXP (x, 1), 1) == UNSPEC_TLSLE)
-    {
-      x = XVECEXP (XEXP (x, 1), 0, 0);
-      gcc_assert (GET_CODE (x) == SYMBOL_REF);
-    }
+  if (GET_CODE (x) == LO_SUM && GET_CODE (XEXP (x, 1)) == UNSPEC)
+    switch (XINT (XEXP (x, 1), 1))
+      {
+      case UNSPEC_MOVE_PIC:
+      case UNSPEC_TLSLE:
+	x = XVECEXP (XEXP (x, 1), 0, 0);
+	gcc_assert (GET_CODE (x) == SYMBOL_REF);
+	break;
+      default:
+	break;
+      }
 
   /* This is generated by mov{si,di}_pic_label_ref in PIC mode.  */
   if (GET_CODE (x) == MINUS