public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [lra] Fix ppc64 bootstrap failure
@ 2011-09-09 20:37 Vladimir Makarov
  0 siblings, 0 replies; only message in thread
From: Vladimir Makarov @ 2011-09-09 20:37 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 358 bytes --]

The following patch fixes compiler crash on stage3 of bootstrap.  The 
patch was successfully bootstrapped on x86/x86-64 and ppc64.

2011-09-09  Vladimir Makarov <vmakarov@redhat.com>

         * lra-constraints.c (equivalence_change_p): Rename to
         debug_loc_equivalence_change_p.  Process subreg of reg whose
         equivalence mode is unknown.



[-- Attachment #2: ppc-bootstrap.patch --]
[-- Type: text/plain, Size: 2154 bytes --]

Index: lra-constraints.c
===================================================================
--- lra-constraints.c	(revision 178707)
+++ lra-constraints.c	(working copy)
@@ -3113,17 +3113,30 @@ contains_pseudo_p (rtx x, bool spilled_p
   return false;
 }
 
-/* Process all regs in *LOC and change them on equivalent
-   substitution.  Return true if any change was done.  */
+/* Process all regs in debug location *LOC and change them on
+   equivalent substitution.  Return true if any change was done.  */
 static bool
-equivalence_change_p (rtx *loc)
+debug_loc_equivalence_change_p (rtx *loc)
 {
-  rtx subst, x = *loc;
+  rtx subst, reg, x = *loc;
   bool result = false;
   enum rtx_code code = GET_CODE (x);
   const char *fmt;
   int i, j;
 
+  if (code == SUBREG)
+    {
+      reg = SUBREG_REG (x);
+      if ((subst = get_equiv_substitution (reg)) != reg
+	  && GET_MODE (subst) == VOIDmode)
+	{
+	  /* We cannot reload debug location.  Simplify subreg here
+	     while we know the inner mode.  */
+	  *loc = simplify_gen_subreg (GET_MODE (x), subst,
+				      GET_MODE (reg), SUBREG_BYTE (x));
+	  return true;
+	}
+    }
   if (code == REG && (subst = get_equiv_substitution (x)) != x)
     {
       *loc = subst;
@@ -3135,10 +3148,11 @@ equivalence_change_p (rtx *loc)
   for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
     {
       if (fmt[i] == 'e')
-	result = equivalence_change_p (&XEXP (x, i)) || result;
+	result = debug_loc_equivalence_change_p (&XEXP (x, i)) || result;
       else if (fmt[i] == 'E')
 	for (j = XVECLEN (x, i) - 1; j >= 0; j--)
-	  result = equivalence_change_p (&XVECEXP (x, i, j)) || result;
+	  result
+	    = debug_loc_equivalence_change_p (&XVECEXP (x, i, j)) || result;
     }
   return result;
 }
@@ -3237,7 +3251,7 @@ lra_constraints (bool first_p)
 	  /* We need to check equivalence in debug insn and change
 	     pseudo to the equivalent value if necessary.  */
 	  curr_id = lra_get_insn_recog_data (curr_insn);
-	  if (equivalence_change_p (curr_id->operand_loc[0]))
+	  if (debug_loc_equivalence_change_p (curr_id->operand_loc[0]))
 	    changed_p = true;
 	}
       else if (INSN_P (curr_insn))

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-09-09 20:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-09 20:37 [lra] Fix ppc64 bootstrap failure Vladimir Makarov

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).