Patchwork fix target/44606, reload bug on SPE

login
register
mail settings
Submitter Nathan Froyd
Date Oct. 5, 2010, 5:36 p.m.
Message ID <20101005173625.GX32503@codesourcery.com>
Download mbox | patch
Permalink /patch/66850/
State New
Headers show

Comments

Nathan Froyd - Oct. 5, 2010, 5:36 p.m.
On Fri, Oct 01, 2010 at 12:16:50AM +0200, Eric Botcazou wrote:
> > Bootstrapping in progress on x86-64.  OK to commit and backport to 4.5
> > and 4.4?
> >
> > gcc/
> > 	* reload1.c (emit_reload_insns): Adjust prototype.  Check for
> > 	inherited output reloads.
> 
> The return value must be documented.
> 
> > 	(reload_as_needed): Delete insn if emit_reload_insns returns
> > 	true.
> > 	(choose_reload_regs): Save equiv in reload_override_in for
> > 	output reloads.  Set reg_rtx from reload_override_in.
> 
> I think that deleting new insns in reload is too risky on the branches.  Can't 
> we tighten the above condition instead on the branches so that it will return 
> false in this case?

Returning to this thread, are you indicating that the deleting insns
approach is OK for trunk (I will post another patch addressing comments
if so), but you'd like to see something like the following (untested)
patch for release branches?  Or would you like to see something
Eric Botcazou - Oct. 7, 2010, 1:21 p.m.
> Returning to this thread, are you indicating that the deleting insns
> approach is OK for trunk (I will post another patch addressing comments
> if so), but you'd like to see something like the following (untested)
> patch for release branches?  Or would you like to see something
> different for trunk as well?

I think that the initial patch for the trunk is too risky for the branches and 
proposed to tighten the condition instead on the branches.  Then I suggested
a possible way of tightening this condition: adding a check that the modes  
have the same size when this is for an output reload.  But I'm fine with any 
solutions that don't delete new insns in the reload pass on the branches.

Patch

different for trunk as well?  Please clarify.  Thanks.

-Nathan

	PR target/44606
	* reload.c (find_equiv_reg): Delete code that attempts to find
	equivalences from CONST_DOUBLEs.

Index: reload.c
===================================================================
--- reload.c	(revision 300577)
+++ reload.c	(working copy)
@@ -6838,33 +6838,9 @@  find_equiv_reg (rtx goal, rtx insn, enum
 		     into a reg, we can use that reg.  */
 		  || (goal_const && REG_NOTES (p) != 0
 		      && (tem = find_reg_note (p, REG_EQUIV, NULL_RTX))
-		      && ((rtx_equal_p (XEXP (tem, 0), goal)
-			   && (valueno
-			       = true_regnum (valtry = SET_DEST (pat))) >= 0)
-			  || (REG_P (SET_DEST (pat))
-			      && GET_CODE (XEXP (tem, 0)) == CONST_DOUBLE
-			      && SCALAR_FLOAT_MODE_P (GET_MODE (XEXP (tem, 0)))
-			      && CONST_INT_P (goal)
-			      && 0 != (goaltry
-				       = operand_subword (XEXP (tem, 0), 0, 0,
-							  VOIDmode))
-			      && rtx_equal_p (goal, goaltry)
-			      && (valtry
-				  = operand_subword (SET_DEST (pat), 0, 0,
-						     VOIDmode))
-			      && (valueno = true_regnum (valtry)) >= 0)))
-		  || (goal_const && (tem = find_reg_note (p, REG_EQUIV,
-							  NULL_RTX))
-		      && REG_P (SET_DEST (pat))
-		      && GET_CODE (XEXP (tem, 0)) == CONST_DOUBLE
-		      && SCALAR_FLOAT_MODE_P (GET_MODE (XEXP (tem, 0)))
-		      && CONST_INT_P (goal)
-		      && 0 != (goaltry = operand_subword (XEXP (tem, 0), 1, 0,
-							  VOIDmode))
-		      && rtx_equal_p (goal, goaltry)
-		      && (valtry
-			  = operand_subword (SET_DEST (pat), 1, 0, VOIDmode))
-		      && (valueno = true_regnum (valtry)) >= 0)))
+		      && (rtx_equal_p (XEXP (tem, 0), goal)
+			  && (valueno
+			      = true_regnum (valtry = SET_DEST (pat))) >= 0))))
 	    {
 	      if (other >= 0)
 		{