From patchwork Wed Nov 7 12:47:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: : Update bb->count to avoid erroneous partitioning decisions Date: Wed, 07 Nov 2012 02:47:28 -0000 From: Christian Bruel X-Patchwork-Id: 197657 Message-Id: <509A5860.3060503@st.com> To: Jan Hubicka Cc: "gcc-patches@gcc.gnu.org" > OK, > is bb1 going to die? If not, probably bb1->count = 0 should be there, if so, > then the bb1->frequency = 0 is redundant. Agree, we do 'delete_basic_block (bb1)' and the frequency is not used in between, so the setting to 0 seems unnecessary. testing it: OK when validation completes ? thanks Christian Index: tree-ssa-tail-merge.c =================================================================== --- tree-ssa-tail-merge.c (revision 193283) +++ tree-ssa-tail-merge.c (working copy) @@ -1488,8 +1488,9 @@ replace_block_by (basic_block bb1, basic_block bb2 bb2->frequency += bb1->frequency; if (bb2->frequency > BB_FREQ_MAX) bb2->frequency = BB_FREQ_MAX; - bb1->frequency = 0; + bb2->count += bb1->count; + /* Do updates that use bb1, before deleting bb1. */ release_last_vdef (bb1); same_succ_flush_bb (bb1);