[backport gcc-4.8/trunk r196252 <mikpe@it.uu.se>]

gcc/

2013-02-25  Andrey Belevantsev  <abel@ispras.ru>
	    Alexander Monakov  <amonakov@ispras.ru>

	PR middle-end/56077
	* sched-deps.c (sched_analyze_insn): When reg_pending_barrier,
	flush pending lists also on non-jumps.  Adjust comment.

--- gcc-4.6.3/gcc/sched-deps.c.~1~	2011-12-08 14:33:58.000000000 +0100
+++ gcc-4.6.3/gcc/sched-deps.c	2013-03-02 16:23:23.923003163 +0100
@@ -3042,9 +3042,9 @@ sched_analyze_insn (struct deps_desc *de
             SET_REGNO_REG_SET (&deps->reg_last_in_use, i);
           }
 
-      /* Flush pending lists on jumps, but not on speculative checks.  */
-      if (JUMP_P (insn) && !(sel_sched_p ()
-                             && sel_insn_is_speculation_check (insn)))
+      /* Don't flush pending lists on speculative checks and for
+	 selective scheduling.  */
+      if (!sel_sched_p () || !sel_insn_is_speculation_check (insn))
 	flush_pending_lists (deps, insn, true, true);
 
       if (!deps->readonly)
