summaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 105e5a1dde7..d75ea80c956 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -4118,7 +4118,7 @@ verify_gimple_assign_binary (gassign *stmt)
/* Continue with generic binary expression handling. */
break;
- case STRICT_REDUC_PLUS_EXPR:
+ case FOLD_LEFT_PLUS_EXPR:
if (!VECTOR_TYPE_P (rhs2_type)
|| !useless_type_conversion_p (lhs_type, TREE_TYPE (rhs2_type))
|| !useless_type_conversion_p (lhs_type, rhs1_type))
@@ -9105,7 +9105,7 @@ pass_warn_function_return::execute (function *fun)
/* If we see "return;" in some basic block, then we do reach the end
without returning a value. */
- else if (warn_return_type
+ else if (warn_return_type > 0
&& !TREE_NO_WARNING (fun->decl)
&& EDGE_COUNT (EXIT_BLOCK_PTR_FOR_FN (fun)->preds) > 0
&& !VOID_TYPE_P (TREE_TYPE (TREE_TYPE (fun->decl))))
@@ -9259,7 +9259,7 @@ execute_fixup_cfg (void)
gimple_stmt_iterator gsi;
int todo = 0;
cgraph_node *node = cgraph_node::get (current_function_decl);
- profile_count num = node->count;
+ profile_count num = node->count.ipa ();
profile_count den = ENTRY_BLOCK_PTR_FOR_FN (cfun)->count;
bool scale = num.initialized_p () && den.ipa_p ()
&& (den.nonzero_p () || num == profile_count::zero ())
@@ -9275,7 +9275,15 @@ execute_fixup_cfg (void)
FOR_EACH_BB_FN (bb, cfun)
{
if (scale)
- bb->count = bb->count.apply_scale (num, den);
+ {
+ if (num == profile_count::zero ())
+ {
+ if (!(bb->count == profile_count::zero ()))
+ bb->count = bb->count.global0 ();
+ }
+ else
+ bb->count = bb->count.apply_scale (num, den);
+ }
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi);)
{
gimple *stmt = gsi_stmt (gsi);
@@ -9365,11 +9373,8 @@ execute_fixup_cfg (void)
if (!cfun->after_inlining)
{
gcall *call_stmt = dyn_cast <gcall *> (stmt);
- int freq
- = compute_call_stmt_bb_frequency (current_function_decl,
- bb);
node->create_edge (cgraph_node::get_create (fndecl),
- call_stmt, bb->count, freq);
+ call_stmt, bb->count);
}
}
}