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

login
register
mail settings
Submitter Alexandre Oliva
Date Sept. 6, 2010, 5:22 p.m.
Message ID <oroccaokhn.fsf@livre.localdomain>
Download mbox | patch
Permalink /patch/63948/
State New
Headers show

Comments

Alexandre Oliva - Sept. 6, 2010, 5:22 p.m.
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?
Andrey Belevantsev - Sept. 16, 2010, 7:02 a.m.
Hi,

Sorry from missing your mail, I've just got back from a vacation.

On 06.09.2010 21:22, Alexandre Oliva wrote:
> 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?
I cannot approve your patch (maybe it's time for me to apply for sel-sched 
maintainership, whatever), but it looks fine.  I am willing to spend time 
on adding proper VTA support to sel-sched, hoping that you can help me with 
explaining what kind of behavior are you expecting from the scheduler.

Andrey

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-09-06 14:10:02.000000000 -0300
+++ gcc/sel-sched.c	2010-09-06 14:12:26.000000000 -0300
@@ -2136,6 +2136,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);