Patchwork fix target/44606, reload bug on SPE

login
register
mail settings
Submitter Bernd Schmidt
Date Oct. 5, 2010, 8:20 p.m.
Message ID <4CAB8895.4040103@codesourcery.com>
Download mbox | patch
Permalink /patch/66858/
State New
Headers show

Comments

Bernd Schmidt - Oct. 5, 2010, 8:20 p.m.
On 10/05/2010 07:36 PM, Nathan Froyd wrote:
> 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
> different for trunk as well?  Please clarify.  Thanks.

I think the following is probably appropriate given my failed attempt to
get this optimization to trigger.


Bernd

Patch

Index: reload1.c
===================================================================
--- reload1.c	(revision 164961)
+++ reload1.c	(working copy)
@@ -6600,17 +6600,6 @@  choose_reload_regs (struct insn_chain *c
 	      && (rld[r].nregs == max_group_size
 		  || ! reg_classes_intersect_p (rld[r].rclass, group_class)))
 	    search_equiv = rld[r].in;
-	  /* If this is an output reload from a simple move insn, look
-	     if an equivalence for the input is available.  */
-	  else if (inheritance && rld[r].in == 0 && rld[r].out != 0)
-	    {
-	      rtx set = single_set (insn);
-
-	      if (set
-		  && rtx_equal_p (rld[r].out, SET_DEST (set))
-		  && CONSTANT_P (SET_SRC (set)))
-		search_equiv = SET_SRC (set);
-	    }
 
 	  if (search_equiv)
 	    {