Commit 1315099e by Tom de Vries Committed by Tom de Vries

Save and restore EDGE_DFS_BACK in draw_cfg_edges

2017-07-04  Tom de Vries  <tom@codesourcery.com>

	* graph.c (draw_cfg_edges): Save and restore EDGE_DFS_BACK.

From-SVN: r249954
parent b85a969e
2017-07-04 Tom de Vries <tom@codesourcery.com>
* graph.c (draw_cfg_edges): Save and restore EDGE_DFS_BACK.
2017-07-03 Dominique d'Humieres <dominiq@lps.ens.fr> 2017-07-03 Dominique d'Humieres <dominiq@lps.ens.fr>
PR target/81033 PR target/81033
......
...@@ -247,19 +247,42 @@ draw_cfg_nodes (pretty_printer *pp, struct function *fun) ...@@ -247,19 +247,42 @@ draw_cfg_nodes (pretty_printer *pp, struct function *fun)
} }
/* Draw all edges in the CFG. Retreating edges are drawin as not /* Draw all edges in the CFG. Retreating edges are drawin as not
constraining, this makes the layout of the graph better. constraining, this makes the layout of the graph better. */
(??? Calling mark_dfs_back may change the compiler's behavior when
dumping, but computing back edges here for ourselves is also not
desirable.) */
static void static void
draw_cfg_edges (pretty_printer *pp, struct function *fun) draw_cfg_edges (pretty_printer *pp, struct function *fun)
{ {
basic_block bb; basic_block bb;
/* Save EDGE_DFS_BACK flag to dfs_back. */
auto_bitmap dfs_back;
edge e;
edge_iterator ei;
unsigned int idx = 0;
FOR_EACH_BB_FN (bb, cfun)
FOR_EACH_EDGE (e, ei, bb->succs)
{
if (e->flags & EDGE_DFS_BACK)
bitmap_set_bit (dfs_back, idx);
idx++;
}
mark_dfs_back_edges (); mark_dfs_back_edges ();
FOR_ALL_BB_FN (bb, cfun) FOR_ALL_BB_FN (bb, cfun)
draw_cfg_node_succ_edges (pp, fun->funcdef_no, bb); draw_cfg_node_succ_edges (pp, fun->funcdef_no, bb);
/* Restore EDGE_DFS_BACK flag from dfs_back. */
idx = 0;
FOR_EACH_BB_FN (bb, cfun)
FOR_EACH_EDGE (e, ei, bb->succs)
{
if (bitmap_bit_p (dfs_back, idx))
e->flags |= EDGE_DFS_BACK;
else
e->flags &= ~EDGE_DFS_BACK;
idx++;
}
/* Add an invisible edge from ENTRY to EXIT, to improve the graph layout. */ /* Add an invisible edge from ENTRY to EXIT, to improve the graph layout. */
pp_printf (pp, pp_printf (pp,
"\tfn_%d_basic_block_%d:s -> fn_%d_basic_block_%d:n " "\tfn_%d_basic_block_%d:s -> fn_%d_basic_block_%d:n "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment