[RS6000] power8 internal compiler errors

Alan Modra amodra@gmail.com
Mon Feb 10 22:18:00 GMT 2014


Since reload may make multiple passes through insns, rtl seen during
reload can look a little messy.  On the second and subsequent passes
you get to see any transformations made on previous passes.  The rtl
sanity checks in rs6000_secondary_reload_inner didn't take this fact
into account, leading to these PRs..

So, sanity check the rtl as it will be after reload.  It is also
correct for any insn emitted in rs6000_secondary_reload_inner to use
the final rtl too.  Bootstrapped and regression tested
powerpc64-linux.  OK to apply?

	PR target/58675
	PR target/57935
	* config/rs6000/rs6000.c (rs6000_secondary_reload_inner): Use
	find_replacement on parts of insn rtl that might be reloaded.

Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c	(revision 207649)
+++ gcc/config/rs6000/rs6000.c	(working copy)
@@ -16170,7 +16170,7 @@
     rs6000_secondary_reload_fail (__LINE__, reg, mem, scratch, store_p);
 
   rclass = REGNO_REG_CLASS (regno);
-  addr = XEXP (mem, 0);
+  addr = find_replacement (&XEXP (mem, 0));
 
   switch (rclass)
     {
@@ -16181,7 +16181,7 @@
       if (GET_CODE (addr) == AND)
 	{
 	  and_op2 = XEXP (addr, 1);
-	  addr = XEXP (addr, 0);
+	  addr = find_replacement (&XEXP (addr, 0));
 	}
 
       if (GET_CODE (addr) == PRE_MODIFY)
@@ -16190,10 +16190,9 @@
 	  if (!REG_P (scratch_or_premodify))
 	    rs6000_secondary_reload_fail (__LINE__, reg, mem, scratch, store_p);
 
-	  if (GET_CODE (XEXP (addr, 1)) != PLUS)
-	    rs6000_secondary_reload_fail (__LINE__, reg, mem, scratch, store_p);
-
 	  addr = XEXP (addr, 1);
+	  if (GET_CODE (addr) != PLUS)
+	    rs6000_secondary_reload_fail (__LINE__, reg, mem, scratch, store_p);
 	}
 
       if (GET_CODE (addr) == PLUS
@@ -16201,7 +16200,7 @@
 	      || !rs6000_legitimate_offset_address_p (PTImode, addr,
 						      false, true)))
 	{
-	  addr_op1 = XEXP (addr, 0);
+	  addr_op1 = find_replacement (&XEXP (addr, 0));
 	  addr_op2 = XEXP (addr, 1);
 	  if (!legitimate_indirect_address_p (addr_op1, false))
 	    rs6000_secondary_reload_fail (__LINE__, reg, mem, scratch, store_p);
@@ -16276,7 +16275,7 @@
 	      || !VECTOR_MEM_ALTIVEC_P (mode)))
 	{
 	  and_op2 = XEXP (addr, 1);
-	  addr = XEXP (addr, 0);
+	  addr = find_replacement (&XEXP (addr, 0));
 	}
 
       /* If we aren't using a VSX load, save the PRE_MODIFY register and use it
@@ -16292,10 +16291,9 @@
 	  if (!legitimate_indirect_address_p (scratch_or_premodify, false))
 	    rs6000_secondary_reload_fail (__LINE__, reg, mem, scratch, store_p);
 
-	  if (GET_CODE (XEXP (addr, 1)) != PLUS)
-	    rs6000_secondary_reload_fail (__LINE__, reg, mem, scratch, store_p);
-
 	  addr = XEXP (addr, 1);
+	  if (GET_CODE (addr) != PLUS)
+	    rs6000_secondary_reload_fail (__LINE__, reg, mem, scratch, store_p);
 	}
 
       if (legitimate_indirect_address_p (addr, false)	/* reg */
@@ -16310,7 +16308,7 @@
 
       else if (GET_CODE (addr) == PLUS)
 	{
-	  addr_op1 = XEXP (addr, 0);
+	  addr_op1 = find_replacement (&XEXP (addr, 0));
 	  addr_op2 = XEXP (addr, 1);
 	  if (!REG_P (addr_op1))
 	    rs6000_secondary_reload_fail (__LINE__, reg, mem, scratch, store_p);

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Gcc-patches mailing list