From: Andre Vieira Date: Tue, 17 Oct 2023 14:02:29 +0000 (+0100) Subject: tree-cfg: Add count information when creating new bb in move_sese_region_to_fn X-Git-Tag: basepoints/gcc-15~5455 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=305034e3ae9499264c539ec14529e849eef7d725;p=thirdparty%2Fgcc.git tree-cfg: Add count information when creating new bb in move_sese_region_to_fn This patch makes sure the profile_count information is initialized for the new bb created in move_sese_region_to_fn. gcc/ChangeLog: * tree-cfg.cc (move_sese_region_to_fn): Initialize profile_count for new basic block. --- diff --git a/gcc/tree-cfg.cc b/gcc/tree-cfg.cc index ffab7518b156..ffeb20b717ae 100644 --- a/gcc/tree-cfg.cc +++ b/gcc/tree-cfg.cc @@ -8160,11 +8160,14 @@ move_sese_region_to_fn (struct function *dest_cfun, basic_block entry_bb, bb = create_empty_bb (entry_pred[0]); if (current_loops) add_bb_to_loop (bb, loop); + profile_count count = profile_count::zero (); for (i = 0; i < num_entry_edges; i++) { e = make_edge (entry_pred[i], bb, entry_flag[i]); e->probability = entry_prob[i]; + count += e->count (); } + bb->count = count; for (i = 0; i < num_exit_edges; i++) {