+2005-08-04 Jan Hubicka <jh@suse.cz>
+
+ * 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.
+
2005-08-03 Paul Brook <paul@codesourcery.com>
* function.c (assign_parms): Round current_function_args_size
FOR_EACH_EDGE (e, ei, bb->succs)
{
+ tree last = last_stmt (bb);
+ /* Edge with goto locus might get wrong coverage info unless
+ it is the only edge out of BB.
+ Don't do that when the locuses match, so
+ if (blah) goto something;
+ is not computed twice. */
+ if (e->goto_locus && !single_succ_p (bb)
+#ifdef USE_MAPPED_LOCATION
+ && (LOCATION_FILE (e->goto_locus)
+ != LOCATION_FILE (EXPR_LOCATION (last))
+ || (LOCATION_LINE (e->goto_locus)
+ != LOCATION_LINE (EXPR_LOCATION (last)))))
+#else
+ && (e->goto_locus->file != EXPR_LOCUS (last)->file
+ || (e->goto_locus->line
+ != EXPR_LOCUS (last)->line)))
+#endif
+ {
+ basic_block new = split_edge (e);
+ single_succ_edge (new)->goto_locus = e->goto_locus;
+ }
if ((e->flags & (EDGE_ABNORMAL | EDGE_ABNORMAL_CALL))
&& e->dest != EXIT_BLOCK_PTR)
need_exit_edge = 1;
+2005-08-04 Jan Hubicka <jh@suse.cz>
+
+ * gcov-1.C: Fix switch counts.
+ * gcov-4b.c: Likewise.
+
2005-08-03 Jeff Law <law@redhat.com>
* g++.dg/tree-ssa/pr14814.C: xfail test for &this count.
{
int result = 0; /* count(5) */
- /* branch(80 25) */
+ /* branch(20 0 60 20) */
switch (i) /* count(5) */
/* branch(end) */
{
{
int result = 0;
- switch (i) /* branch(80 25) */
+ switch (i) /* branch(20 0 60 20) */
/* branch(end) */
{
case 1:
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);
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. */