[PATCH] Fix powerpc bootstrap when using --enable-checking=rtl

Peter Bergner bergner@vnet.ibm.com
Tue Nov 21 22:30:00 GMT 2006


On Mon, Nov 20, 2006 at 12:57:56PM -0600, Peter Bergner wrote:
> Ah yes, that would be better.  I'll make those two changes and retest.

Ok, this bootstrapped and regtested with no failures on powerpc64-linux
(-m32 and -m64).  Ok for mainline?

Peter



2006-11-21  Peter Bergner  <bergner@vnet.ibm.com>

	* config/rs6000/rs6000.c (get_store_dest): New.
	(adjacent_mem_locations): Use get_store_dest() to get
	the rtl of the store destination.

Index: config/rs6000/rs6000.c
===================================================================
--- config/rs6000/rs6000.c	(revision 119022)
+++ config/rs6000/rs6000.c	(working copy)
@@ -693,6 +693,7 @@
 static bool is_cracked_insn (rtx);
 static bool is_branch_slot_insn (rtx);
 static bool is_load_insn (rtx);
+static rtx get_store_dest (rtx pat);
 static bool is_store_insn (rtx);
 static bool set_to_load_agen (rtx,rtx);
 static bool adjacent_mem_locations (rtx,rtx); 
@@ -17055,9 +17056,9 @@
 adjacent_mem_locations (rtx insn1, rtx insn2)
 {
 
-  rtx a = SET_DEST (PATTERN (insn1));
-  rtx b = SET_DEST (PATTERN (insn2));
- 
+  rtx a = get_store_dest (PATTERN (insn1));
+  rtx b = get_store_dest (PATTERN (insn2));
+
   if ((GET_CODE (XEXP (a, 0)) == REG
        || (GET_CODE (XEXP (a, 0)) == PLUS
 	   && GET_CODE (XEXP (XEXP (a, 0), 1)) == CONST_INT))
@@ -17363,6 +17364,32 @@
   return is_store_insn1 (PATTERN (insn));
 }
 
+/* Return the dest of a store insn.  */
+
+static rtx
+get_store_dest (rtx pat)
+{
+  gcc_assert (is_store_insn1 (pat));
+
+  if (GET_CODE (pat) == SET)
+    return SET_DEST (pat);
+  else if (GET_CODE (pat) == PARALLEL)
+    {
+      int i;
+
+      for (i = 0; i < XVECLEN (pat, 0); i++)
+	{
+	  rtx inner_pat = XVECEXP (pat, 0, i);
+	  if (GET_CODE (inner_pat) == SET
+	      && is_mem_ref (SET_DEST (inner_pat)))
+	    return inner_pat;
+	}
+    }
+  /* We shouldn't get here, because we should have either a simple
+     store insn or a store with update which are covered above.  */
+  gcc_unreachable();
+}
+
 /* Returns whether the dependence between INSN and NEXT is considered
    costly by the given target.  */
 



More information about the Gcc-patches mailing list