Hello,

The attached patch avoids considering debug_insn when calculating SCCs.
With this change the existence of debug_insn does not influence
the scheduling order and rec_MII.

Bootstrap and regtest on ppc64-redhat-linux and regtest on arm-linux-gnueabi.

OK for mainline?

Thanks,
Revital

Changelog:

* ddg.c (find_nodes_on_paths): Ignore DEBUG_INSNs.
=== modified file 'gcc/ddg.c'
--- gcc/ddg.c   2011-03-27 07:11:08 +0000
+++ gcc/ddg.c   2011-04-11 12:04:54 +0000
@@ -1116,13 +1116,19 @@ find_nodes_on_paths (sbitmap result, ddg
        {
          ddg_edge_ptr e;
          ddg_node_ptr u_node = &g->nodes[u];
-
+         
+         /* Ignore DEBUG_INSNs when calculating the SCCs to avoid their
+            influence on the scheduling order and rec_mii.  */
+         if (DEBUG_INSN_P (u_node->insn))
+           continue;
+         
          for (e = u_node->out; e != (ddg_edge_ptr) 0; e = e->next_out)
            {
              ddg_node_ptr v_node = e->dest;
              int v = v_node->cuid;
 
-             if (!TEST_BIT (reachable_from, v))
+             /* Ignore DEBUG_INSN when calculating the SCCs.  */
+             if (!TEST_BIT (reachable_from, v) && !DEBUG_INSN_P (v_node->insn))
                {
                  SET_BIT (reachable_from, v);
                  SET_BIT (tmp, v);
@@ -1146,12 +1152,18 @@ find_nodes_on_paths (sbitmap result, ddg
          ddg_edge_ptr e;
          ddg_node_ptr u_node = &g->nodes[u];
 
+         /* Ignore DEBUG_INSNs when calculating the SCCs to avoid their
+            influence on the scheduling order and rec_mii.  */
+         if (DEBUG_INSN_P (u_node->insn))
+           continue;
+         
          for (e = u_node->in; e != (ddg_edge_ptr) 0; e = e->next_in)
            {
              ddg_node_ptr v_node = e->src;
              int v = v_node->cuid;
 
-             if (!TEST_BIT (reach_to, v))
+             /* Ignore DEBUG_INSN when calculating the SCCs.  */
+             if (!TEST_BIT (reach_to, v) && !DEBUG_INSN_P (v_node->insn))
                {
                  SET_BIT (reach_to, v);
                  SET_BIT (tmp, v);

Reply via email to