diff mbox

[4.7] revisit PR middle-end/56848 for 4.7.4

Message ID 51701E7C.7070105@ubuntu.com
State New
Headers show

Commit Message

Matthias Klose April 18, 2013, 4:25 p.m. UTC
revisit PR middle-end/56848 for 4.7.4. as outlined in the bug report, this
reapplies the patch backed out for the 4.7.3 release and backports r190733.
No regressions in the testsuite on x86_64-linux-gnu compared to the 4.7.3
release. Ok to apply?

  Matthias
gcc/
2013-04-18  Matthias Klose  <doko@ubuntu.com>

	PR middle-end/56848
	Re-apply
	2013-04-01  Andrey Belevantsev  <abel@ispras.ru>

	Backport from mainline
	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.

	Backport:
	2012-08-27  Maxim Kuvyrkov  <maxim@codesourcery.com>

	* sched-deps.c (add_dependence_list_and_free): Simplify.
	(flush_pending_list_and_free): Fix a hack that was fixing a hack.  Free
	lists when add_dependence_list_and_free doesn't free them.

Comments

Richard Biener April 19, 2013, 8:09 a.m. UTC | #1
On Thu, Apr 18, 2013 at 6:25 PM, Matthias Klose <doko@ubuntu.com> wrote:
> revisit PR middle-end/56848 for 4.7.4. as outlined in the bug report, this
> reapplies the patch backed out for the 4.7.3 release and backports r190733.
> No regressions in the testsuite on x86_64-linux-gnu compared to the 4.7.3
> release. Ok to apply?

Ok.

Thanks,
Richard.

>   Matthias
>
diff mbox

Patch

Index: gcc/sched-deps.c
===================================================================
--- a/src/gcc/sched-deps.c	(revision 198053)
+++ b/src/gcc/sched-deps.c	(working copy)
@@ -1563,24 +1563,15 @@ 
 add_dependence_list_and_free (struct deps_desc *deps, rtx insn, rtx *listp,
                               int uncond, enum reg_note dep_type)
 {
-  rtx list, next;
+  add_dependence_list (insn, *listp, uncond, dep_type);
 
   /* We don't want to short-circuit dependencies involving debug
      insns, because they may cause actual dependencies to be
      disregarded.  */
   if (deps->readonly || DEBUG_INSN_P (insn))
-    {
-      add_dependence_list (insn, *listp, uncond, dep_type);
-      return;
-    }
+    return;
 
-  for (list = *listp, *listp = NULL; list ; list = next)
-    {
-      next = XEXP (list, 1);
-      if (uncond || ! sched_insns_conditions_mutex_p (insn, XEXP (list, 0)))
-	add_dependence (insn, XEXP (list, 0), dep_type);
-      free_INSN_LIST_node (list);
-    }
+  free_INSN_LIST_list (listp);
 }
 
 /* Remove all occurences of INSN from LIST.  Return the number of
@@ -1764,6 +1755,15 @@ 
   add_dependence_list_and_free (deps, insn, &deps->pending_jump_insns, 1,
 				REG_DEP_ANTI);
 
+  if (DEBUG_INSN_P (insn))
+    {
+      if (for_write)
+	free_INSN_LIST_list (&deps->pending_read_insns);
+      free_INSN_LIST_list (&deps->pending_write_insns);
+      free_INSN_LIST_list (&deps->last_pending_memory_flush);
+      free_INSN_LIST_list (&deps->pending_jump_insns);
+    }
+
   if (!deps->readonly)
     {
       free_EXPR_LIST_list (&deps->pending_write_mems);
@@ -3262,9 +3262,9 @@ 
             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 for
+	 selective scheduling.  */
+      if (!sel_sched_p () || !sel_insn_is_speculation_check (insn))
 	flush_pending_lists (deps, insn, true, true);
 
       reg_pending_barrier = NOT_A_BARRIER;