Commit 62b857ea by Richard Henderson Committed by Richard Henderson

basic-block.h (struct edge_def): Add goto_locus.

        * basic-block.h (struct edge_def): Add goto_locus.
        * tree-cfg.c (make_goto_expr_edges): Set it.
        (disband_implicit_edges): Use it.
        * tree-pretty-print.c (dump_implicit_edges): Print it.

From-SVN: r82842
parent 93a9f7d6
2004-06-09 Richard Henderson <rth@redhat.com>
* basic-block.h (struct edge_def): Add goto_locus.
* tree-cfg.c (make_goto_expr_edges): Set it.
(disband_implicit_edges): Use it.
* tree-pretty-print.c (dump_implicit_edges): Print it.
2004-06-08 Anil Paranjpe <anilp1@kpitcummins.com> 2004-06-08 Anil Paranjpe <anilp1@kpitcummins.com>
* h8300.md (ldm_h8300s_4): Fix condition for expander. * h8300.md (ldm_h8300s_4): Fix condition for expander.
......
...@@ -142,6 +142,9 @@ struct edge_def GTY((chain_next ("%h.pred_next"))) ...@@ -142,6 +142,9 @@ struct edge_def GTY((chain_next ("%h.pred_next")))
/* Auxiliary info specific to a pass. */ /* Auxiliary info specific to a pass. */
PTR GTY ((skip (""))) aux; PTR GTY ((skip (""))) aux;
/* Location of any goto implicit in the edge, during tree-ssa. */
location_t *goto_locus;
int flags; /* see EDGE_* below */ int flags; /* see EDGE_* below */
int probability; /* biased by REG_BR_PROB_BASE */ int probability; /* biased by REG_BR_PROB_BASE */
gcov_type count; /* Expected number of executions calculated gcov_type count; /* Expected number of executions calculated
......
...@@ -680,7 +680,8 @@ make_goto_expr_edges (basic_block bb) ...@@ -680,7 +680,8 @@ make_goto_expr_edges (basic_block bb)
/* A GOTO to a local label creates normal edges. */ /* A GOTO to a local label creates normal edges. */
if (simple_goto_p (goto_t)) if (simple_goto_p (goto_t))
{ {
make_edge (bb, label_to_block (dest), EDGE_FALLTHRU); edge e = make_edge (bb, label_to_block (dest), EDGE_FALLTHRU);
e->goto_locus = EXPR_LOCUS (goto_t);
bsi_remove (&last); bsi_remove (&last);
return; return;
} }
...@@ -2640,8 +2641,7 @@ disband_implicit_edges (void) ...@@ -2640,8 +2641,7 @@ disband_implicit_edges (void)
if (e->flags & EDGE_FALLTHRU) if (e->flags & EDGE_FALLTHRU)
break; break;
if (!e if (!e || e->dest == bb->next_bb)
|| e->dest == bb->next_bb)
continue; continue;
if (e->dest == EXIT_BLOCK_PTR) if (e->dest == EXIT_BLOCK_PTR)
...@@ -2658,9 +2658,9 @@ disband_implicit_edges (void) ...@@ -2658,9 +2658,9 @@ disband_implicit_edges (void)
&& TREE_CODE (forward) == GOTO_EXPR) && TREE_CODE (forward) == GOTO_EXPR)
label = GOTO_DESTINATION (forward); label = GOTO_DESTINATION (forward);
bsi_insert_after (&last, stmt = build1 (GOTO_EXPR, void_type_node, label);
build1 (GOTO_EXPR, void_type_node, label), SET_EXPR_LOCUS (stmt, e->goto_locus);
BSI_NEW_STMT); bsi_insert_after (&last, stmt, BSI_NEW_STMT);
e->flags &= ~EDGE_FALLTHRU; e->flags &= ~EDGE_FALLTHRU;
} }
} }
......
...@@ -2227,7 +2227,8 @@ pp_cfg_jump (pretty_printer *buffer, basic_block bb) ...@@ -2227,7 +2227,8 @@ pp_cfg_jump (pretty_printer *buffer, basic_block bb)
by INDENT spaces, with details given by FLAGS. */ by INDENT spaces, with details given by FLAGS. */
static void static void
dump_implicit_edges (pretty_printer *buffer, basic_block bb, int indent) dump_implicit_edges (pretty_printer *buffer, basic_block bb, int indent,
int flags)
{ {
edge e; edge e;
...@@ -2239,6 +2240,19 @@ dump_implicit_edges (pretty_printer *buffer, basic_block bb, int indent) ...@@ -2239,6 +2240,19 @@ dump_implicit_edges (pretty_printer *buffer, basic_block bb, int indent)
if (e && e->dest != bb->next_bb) if (e && e->dest != bb->next_bb)
{ {
INDENT (indent); INDENT (indent);
if ((flags & TDF_LINENO) && e->goto_locus)
{
pp_character (buffer, '[');
if (e->goto_locus->file)
{
pp_string (buffer, e->goto_locus->file);
pp_string (buffer, " : ");
}
pp_decimal_int (buffer, e->goto_locus->line);
pp_string (buffer, "] ");
}
pp_cfg_jump (buffer, e->dest); pp_cfg_jump (buffer, e->dest);
pp_newline (buffer); pp_newline (buffer);
} }
...@@ -2276,7 +2290,7 @@ dump_generic_bb_buff (pretty_printer *buffer, basic_block bb, ...@@ -2276,7 +2290,7 @@ dump_generic_bb_buff (pretty_printer *buffer, basic_block bb,
pp_newline (buffer); pp_newline (buffer);
} }
dump_implicit_edges (buffer, bb, indent); dump_implicit_edges (buffer, bb, indent, flags);
if (flags & TDF_BLOCKS) if (flags & TDF_BLOCKS)
dump_bb_end (buffer, bb, indent, flags); dump_bb_end (buffer, bb, indent, flags);
......
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