Commit 52982a97 by Eric Botcazou Committed by Eric Botcazou

re PR rtl-optimization/33737 (verify_flow_info failed: Wrong probability of edge 94->1 -6651)

	PR rtl-optimization/33737
	* cfgcleanup.c (try_crossjump_to_edge): Add count and frequency of
	target block after computing the probabilities of outgoing edges.
	Cap the frequency to BB_FREQ_MAX.
	* tree-ssa-threadupdate.c (redirect_edges): Also adjust count and
	frequency of the basic block if it has been reused.

From-SVN: r129973
parent 8c6c36a3
2007-11-07 Eric Botcazou <ebotcazou@libertysurf.fr> 2007-11-07 Eric Botcazou <ebotcazou@libertysurf.fr>
PR rtl-optimization/33737
* cfgcleanup.c (try_crossjump_to_edge): Add count and frequency of
target block after computing the probabilities of outgoing edges.
Cap the frequency to BB_FREQ_MAX.
* tree-ssa-threadupdate.c (redirect_edges): Also adjust count and
frequency of the basic block if it has been reused.
2007-11-07 Eric Botcazou <ebotcazou@libertysurf.fr>
PR rtl-optimization/33822 PR rtl-optimization/33822
* rtl.h (REG_OFFSET): Fix comment. * rtl.h (REG_OFFSET): Fix comment.
* var-tracking.c (INT_MEM_OFFSET): New macro. * var-tracking.c (INT_MEM_OFFSET): New macro.
...@@ -1699,8 +1699,6 @@ try_crossjump_to_edge (int mode, edge e1, edge e2) ...@@ -1699,8 +1699,6 @@ try_crossjump_to_edge (int mode, edge e1, edge e2)
"Cross jumping from bb %i to bb %i; %i common insns\n", "Cross jumping from bb %i to bb %i; %i common insns\n",
src1->index, src2->index, nmatch); src1->index, src2->index, nmatch);
redirect_to->count += src1->count;
redirect_to->frequency += src1->frequency;
/* We may have some registers visible through the block. */ /* We may have some registers visible through the block. */
df_set_bb_dirty (redirect_to); df_set_bb_dirty (redirect_to);
...@@ -1757,6 +1755,14 @@ try_crossjump_to_edge (int mode, edge e1, edge e2) ...@@ -1757,6 +1755,14 @@ try_crossjump_to_edge (int mode, edge e1, edge e2)
/ (redirect_to->frequency + src1->frequency)); / (redirect_to->frequency + src1->frequency));
} }
/* Adjust count and frequency for the block. An earlier jump
threading pass may have left the profile in an inconsistent
state (see update_bb_profile_for_threading) so we must be
prepared for overflows. */
redirect_to->count += src1->count;
redirect_to->frequency += src1->frequency;
if (redirect_to->frequency > BB_FREQ_MAX)
redirect_to->frequency = BB_FREQ_MAX;
update_br_prob_note (redirect_to); update_br_prob_note (redirect_to);
/* Edit SRC1 to go to REDIRECT_TO at NEWPOS1. */ /* Edit SRC1 to go to REDIRECT_TO at NEWPOS1. */
......
2007-11-07 Eric Botcazou <ebotcazou@libertysurf.fr> 2007-11-07 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.c-torture/compile/20071107-1.c: New test.
2007-11-07 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.dg/out-of-bounds-1.c: New test. * gcc.dg/out-of-bounds-1.c: New test.
2007-11-07 Jakub Jelinek <jakub@redhat.com> 2007-11-07 Jakub Jelinek <jakub@redhat.com>
...@@ -442,10 +442,14 @@ redirect_edges (void **slot, void *data) ...@@ -442,10 +442,14 @@ redirect_edges (void **slot, void *data)
remove_ctrl_stmt_and_useless_edges (local_info->bb, remove_ctrl_stmt_and_useless_edges (local_info->bb,
rd->outgoing_edge->dest); rd->outgoing_edge->dest);
/* And fixup the flags on the single remaining edge. */ /* Fixup the flags on the single remaining edge. */
single_succ_edge (local_info->bb)->flags single_succ_edge (local_info->bb)->flags
&= ~(EDGE_TRUE_VALUE | EDGE_FALSE_VALUE | EDGE_ABNORMAL); &= ~(EDGE_TRUE_VALUE | EDGE_FALSE_VALUE | EDGE_ABNORMAL);
single_succ_edge (local_info->bb)->flags |= EDGE_FALLTHRU; single_succ_edge (local_info->bb)->flags |= EDGE_FALLTHRU;
/* And adjust count and frequency on BB. */
local_info->bb->count = e->count;
local_info->bb->frequency = EDGE_FREQUENCY (e);
} }
} }
......
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