Patchwork debug insns in SMS

login
register
mail settings
Submitter Alexandre Oliva
Date June 22, 2012, 12:56 a.m.
Message ID <or7gv0yxir.fsf@livre.localdomain>
Download mbox | patch
Permalink /patch/166455/
State New
Headers show

Comments

Alexandre Oliva - June 22, 2012, 12:56 a.m.
On Jun 14, 2012, Ayal Zaks <ayal.zaks@gmail.com> wrote:

> Thanks for the duplicate ping. This is fine.

> So this indeed solves the discrepancy between running SMS w/ and w/o
> debugging?

I can't tell whether it solves it completely, but it's surely a step in
the right direction.

> Please include a comment next to the code stating why it's important
> not to create such deps.

Done

> You may also want to store the result of "DEP_PRO (dep)" in
> src_<something> and use it twice, for clarity.

Done

Here's what I'm about to check in.  Thanks,

Patch

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

	* ddg.c (build_intra_loop_deps): Discard deps of nondebug on debug.

Index: gcc/ddg.c
===================================================================
--- gcc/ddg.c.orig	2012-06-21 21:45:00.305313798 -0300
+++ gcc/ddg.c	2012-06-21 21:51:58.000000000 -0300
@@ -531,7 +531,15 @@  build_intra_loop_deps (ddg_ptr g)
 
       FOR_EACH_DEP (dest_node->insn, SD_LIST_BACK, sd_it, dep)
 	{
-	  ddg_node_ptr src_node = get_node_of_insn (g, DEP_PRO (dep));
+	  rtx src_insn = DEP_PRO (dep);
+	  ddg_node_ptr src_node;
+
+	  /* Don't add dependencies on debug insns to non-debug insns
+	     to avoid codegen differences between -g and -g0.  */
+	  if (DEBUG_INSN_P (src_insn) && !DEBUG_INSN_P (dest_node->insn))
+	    continue;
+
+	  src_node = get_node_of_insn (g, src_insn);
 
 	  if (!src_node)
 	    continue;