summaryrefslogtreecommitdiff
path: root/gcc/predict.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-06 12:31:35 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-06 12:31:35 +0000
commitd5043f32aad364e89ea649d8be0258fcffcece69 (patch)
treeb33345b9d09639a34fdfad1df1f1c467319d43a7 /gcc/predict.c
parentbdf4b4899139c47d5db18b23d21ef8875604d278 (diff)
downloadgcc-d5043f32aad364e89ea649d8be0258fcffcece69.tar.gz
* predict.c (tree_predict_edge): Don't drop useless predictions;
check that it is not called too late in the game. (gate_estimate_probability): New gate. (pass_profile): Gate. * tree-mudflap.c (mf_build_check_statement_for): Do not drop predictions; update CFG instead. * cfgrtl.c (rtl_verify_flow_info): Check that predcitions are consumed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100662 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/predict.c')
-rw-r--r--gcc/predict.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/predict.c b/gcc/predict.c
index 22468ace111..61cc5402e74 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -231,8 +231,9 @@ rtl_predict_edge (edge e, enum br_predictor predictor, int probability)
void
tree_predict_edge (edge e, enum br_predictor predictor, int probability)
{
+ gcc_assert (profile_status != PROFILE_GUESSED);
if ((e->src != ENTRY_BLOCK_PTR && EDGE_COUNT (e->src->succs) > 1)
- && flag_guess_branch_prob)
+ && flag_guess_branch_prob && optimize)
{
struct edge_prediction *i = ggc_alloc (sizeof (struct edge_prediction));
@@ -1926,11 +1927,16 @@ choose_function_section (void)
UNLIKELY_EXECUTED_TEXT_SECTION_NAME);
}
+static bool
+gate_estimate_probability (void)
+{
+ return flag_guess_branch_prob;
+}
struct tree_opt_pass pass_profile =
{
"profile", /* name */
- NULL, /* gate */
+ gate_estimate_probability, /* gate */
tree_estimate_probability, /* execute */
NULL, /* sub */
NULL, /* next */