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]

[vta,vta4.3] skip debug insns when computing crossjump split points


-fcompare-debug let me know that NOTEs sometimes ended up in different
BBs because of debug insns, in crossjumping.  I don't see that this
could modify the generated code, but it's much easier if
-fcompare-debug doesn't have to ignore this kind of difference.

This patch avoids the differences in the first place.  The same patch
applies in both vta and vta4.3 branches.

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

	* cfgcleanup.c (try_crossjump_to_edge): Skip debug insns.

Index: gcc/cfgcleanup.c
===================================================================
--- gcc/cfgcleanup.c.orig	2008-09-05 01:41:51.000000000 -0300
+++ gcc/cfgcleanup.c	2008-09-05 03:09:53.000000000 -0300
@@ -1564,8 +1564,12 @@ try_crossjump_to_edge (int mode, edge e1
 	  /* Skip possible basic block header.  */
 	  if (LABEL_P (newpos2))
 	    newpos2 = NEXT_INSN (newpos2);
+	  while (DEBUG_INSN_P (newpos2))
+	    newpos2 = NEXT_INSN (newpos2);
 	  if (NOTE_P (newpos2))
 	    newpos2 = NEXT_INSN (newpos2);
+	  while (DEBUG_INSN_P (newpos2))
+	    newpos2 = NEXT_INSN (newpos2);
 	}
 
       if (dump_file)
@@ -1651,9 +1655,15 @@ try_crossjump_to_edge (int mode, edge e1
   if (LABEL_P (newpos1))
     newpos1 = NEXT_INSN (newpos1);
 
+  while (DEBUG_INSN_P (newpos1))
+    newpos1 = NEXT_INSN (newpos1);
+
   if (NOTE_P (newpos1))
     newpos1 = NEXT_INSN (newpos1);
 
+  while (DEBUG_INSN_P (newpos1))
+    newpos1 = NEXT_INSN (newpos1);
+
   redirect_from = split_block (src1, PREV_INSN (newpos1))->src;
   to_remove = single_succ (redirect_from);
 
-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}
FSFLA Board Member       ÂSÃ Libre! => http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}

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