public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [RS6000] power8 internal compiler errors
@ 2014-02-10 22:18 Alan Modra
  2014-02-11  0:01 ` David Edelsohn
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Modra @ 2014-02-10 22:18 UTC (permalink / raw)
  To: gcc-patches; +Cc: David Edelsohn, Michael Meissner

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-02-14 14:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-10 22:18 [RS6000] power8 internal compiler errors Alan Modra
2014-02-11  0:01 ` David Edelsohn
2014-02-11  1:33   ` Alan Modra
2014-02-11  4:47     ` David Edelsohn
2014-02-12 16:43     ` David Edelsohn
2014-02-12 17:47       ` Ulrich Weigand
2014-02-14  7:18         ` Alan Modra
2014-02-14 14:38           ` David Edelsohn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).