diff mbox

[PR,debug/45454] restore sel-sched to non-crashing with VTA

Message ID ord3nsfs79.fsf@livre.localdomain
State New
Headers show

Commit Message

Alexandre Oliva Jan. 19, 2011, 10:23 p.m. UTC
On Sep  6, 2010, Alexandre Oliva <aoliva@redhat.com> wrote:

> Selective scheduling is used to cause codegen differences and debug
> information corruption with VTA, so VTA is implicitly disabled on
> platforms that enable selective scheduling.  However, if you force it
> on, you get a warning, and the compiler does its best.

> Unfortunately, since we started tracking dependencies of non-debug insns
> on debug insns, “its best” often turned out to be a crash, because
> internal checking on whether an insn was available would find it to be
> both available and unavailable.

> This patch restores the earlier behavior, by which debug insns never
> stop non-debug insns from being moved ahead of themselves.  Ideally,
> we'd reset or otherwise adjust the debug insn as we plan to move the
> dependent insn ahead of it, but I couldn't figure out a simple way to do
> that.

> Since VTA is incompatible with sel-sched in other ways, I figured I'd
> just fix the crash, and leave a note so that the problem is fixed
> whenever someone who truly understands sel-sched comes up with a good
> way to deal with debug insns.

> Ok to install?

Ping?
diff mbox

Patch

for  gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	PR debug/45454
	* sel-sched.c (moveup_expr): Don't let debug insns prevent
	non-debug insns from moving up.

Index: gcc/sel-sched.c
===================================================================
--- gcc/sel-sched.c.orig	2010-11-26 01:06:02.565820892 -0200
+++ gcc/sel-sched.c	2010-11-26 01:07:58.286593063 -0200
@@ -2141,6 +2141,15 @@  moveup_expr (expr_t expr, insn_t through
   ds_t *has_dep_p;
   ds_t full_ds;
 
+  /* ??? We use dependencies of non-debug insns on debug insns to
+     indicate that the debug insns need to be reset if the non-debug
+     insn is pulled ahead of it.  It's hard to figure out how to
+     introduce such a notion in sel-sched, but it already fails to
+     support debug insns in other ways, so we just go ahead and
+     let the deug insns go corrupt for now.  */
+  if (DEBUG_INSN_P (through_insn) && !DEBUG_INSN_P (insn))
+    return MOVEUP_EXPR_SAME;
+
   /* When inside_insn_group, delegate to the helper.  */
   if (inside_insn_group)
     return moveup_expr_inside_insn_group (expr, through_insn);