diff mbox

Correct fix for scheduler bug PR11320

Message ID 4E3C2B59.60508@codesourcery.com
State New
Headers show

Commit Message

Bernd Schmidt Aug. 5, 2011, 5:41 p.m. UTC
On 07/22/11 19:23, Bernd Schmidt wrote:
> On 07/22/11 19:17, Richard Henderson wrote:
>> On 07/22/2011 10:00 AM, Eric Botcazou wrote:
>>>> It's getting confused about loads/stores being control_flow_insns and
>>>> getting scheduled past each other nonetheless. Mind testing the following?
>>>
>>> s/flag_non_call_exceptions/cfun->can_throw_non_call_exceptions/
>>>
>>
>> Why test either, since control_flow_insn_p has already done so?
> 
> Just to save an unnecessary call to add_dependence.
> 
> Although, come to think of it, it might not be unnecessary. The reason
> these two insns aren't already dependent on each other seems to be that
> they have opposite conditions, and I guess that might happen with
> conditional calls as well.

Ok, so Andreas has verified that the following fixes the problem on
ia64. Ok?


Bernd
PR rtl-optimization/49900
	* sched-ebb.c (add_deps_for_risky_insns): Also add dependencies to
	ensure basic blocks stay in the same order.

Comments

Richard Henderson Aug. 5, 2011, 6:18 p.m. UTC | #1
On 08/05/2011 10:41 AM, Bernd Schmidt wrote:
> 	PR rtl-optimization/49900
> 	* sched-ebb.c (add_deps_for_risky_insns): Also add dependencies to
> 	ensure basic blocks stay in the same order.

Ok.


r~
diff mbox

Patch

Index: gcc/sched-ebb.c
===================================================================
--- gcc/sched-ebb.c	(revision 176879)
+++ gcc/sched-ebb.c	(working copy)
@@ -397,6 +397,9 @@  add_deps_for_risky_insns (rtx head, rtx
 	  bb = BLOCK_FOR_INSN (insn);
 	  bb->aux = last_block;
 	  last_block = bb;
+	  /* Ensure blocks stay in the same order.  */
+	  if (last_jump)
+	    add_dependence (insn, last_jump, REG_DEP_ANTI);
 	  last_jump = insn;
 	}
       else if (INSN_P (insn) && last_jump != NULL_RTX)