[rs6000] Fix bootstrap on powerpc*-darwin* (PR bootstrap/43287)

Jakub Jelinek jakub@redhat.com
Tue Mar 9 09:28:00 GMT 2010


Hi!

After the recent var-tracking changes UNSPEC_MACHOPIC_OFFSET makes it
into some variable's location (before that it was just a latent issue).
This patch fixes it by delegitimizing the MachO pic UNSPEC
(ix86_delegitimize_address has something similar already).
Not tested by me, but by the reporter according to comments in the PR.

Ok for trunk?

2010-03-08  Jakub Jelinek  <jakub@redhat.com>

	PR bootstrap/43287
	* config/rs6000/rs6000.c (rs6000_delegitimize_address): Handle
	UNSPEC_MACHOPIC_OFFSET.

--- gcc/config/rs6000/rs6000.c.jj	2010-03-01 16:31:50.000000000 +0100
+++ gcc/config/rs6000/rs6000.c	2010-03-08 20:03:25.000000000 +0100
@@ -5298,6 +5298,16 @@ rs6000_delegitimize_address (rtx orig_x)
       return orig_x;
     }
 
+  if (TARGET_MACHO
+      && GET_CODE (orig_x) == LO_SUM
+      && GET_CODE (XEXP (x, 1)) == CONST)
+    {
+      y = XEXP (XEXP (x, 1), 0);
+      if (GET_CODE (y) == UNSPEC
+	  && XINT (y, 1) == UNSPEC_MACHOPIC_OFFSET)
+	return XVECEXP (y, 0, 0);
+    }
+
   return orig_x;
 }
 

	Jakub



More information about the Gcc-patches mailing list