diff options
author | Jan Hubicka <jh@suse.cz> | 2005-08-04 00:10:54 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2005-08-03 22:10:54 +0000 |
commit | d783b2a2dc91e1d2c1fea78cac2b6c6c73b3680d (patch) | |
tree | fcee55b5f24d9dfb6674c4dbf7fa3c50e5dfb709 /gcc/tree-cfg.c | |
parent | 5336645054c5bc4bf56215863b9d64bd24884f32 (diff) | |
download | gcc-d783b2a2dc91e1d2c1fea78cac2b6c6c73b3680d.zip gcc-d783b2a2dc91e1d2c1fea78cac2b6c6c73b3680d.tar.gz gcc-d783b2a2dc91e1d2c1fea78cac2b6c6c73b3680d.tar.bz2 |
profile.c (branch_prob): Split edges with goto locus on them to get proper line counts.
* profile.c (branch_prob): Split edges with goto locus on them
to get proper line counts.
* tree-cfg.c (make_cond_expr_edges): Record user goto locuses, if any.
* gcov-1.C: Fix switch counts.
* gcov-4b.c: Likewise.
From-SVN: r102717
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r-- | gcc/tree-cfg.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index bf25f83..096da09 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -577,6 +577,7 @@ make_cond_expr_edges (basic_block bb) tree entry = last_stmt (bb); basic_block then_bb, else_bb; tree then_label, else_label; + edge e; gcc_assert (entry); gcc_assert (TREE_CODE (entry) == COND_EXPR); @@ -587,8 +588,21 @@ make_cond_expr_edges (basic_block bb) then_bb = label_to_block (then_label); else_bb = label_to_block (else_label); - make_edge (bb, then_bb, EDGE_TRUE_VALUE); - make_edge (bb, else_bb, EDGE_FALSE_VALUE); + e = make_edge (bb, then_bb, EDGE_TRUE_VALUE); +#ifdef USE_MAPPED_LOCATION + e->goto_locus = EXPR_LOCATION (COND_EXPR_THEN (entry)); +#else + e->goto_locus = EXPR_LOCUS (COND_EXPR_THEN (entry)); +#endif + e = make_edge (bb, else_bb, EDGE_FALSE_VALUE); + if (e) + { +#ifdef USE_MAPPED_LOCATION + e->goto_locus = EXPR_LOCATION (COND_EXPR_ELSE (entry)); +#else + e->goto_locus = EXPR_LOCUS (COND_EXPR_ELSE (entry)); +#endif + } } /* Hashing routine for EDGE_TO_CASES. */ |