This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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?

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);

-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]