This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix typo in try_peel_loop
- From: Pat Haugen <pthaugen at linux dot ibm dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Jan Hubicka <hubicka at ucw dot cz>
- Date: Wed, 31 Oct 2018 10:32:18 -0500
- Subject: [PATCH] Fix typo in try_peel_loop
I observed the odd looking code while looking into something else and confirmed prior behavior (before r248863) was to sum the counts of the non-latch predecessors of the loop (in order to scale the loop such that it no longer appears to iterate).
Bootstrap/regtest on powerpc64le with no regressions. Committed as obvious.
-Pat
2018-10-31 Pat Haugen <pthaugen@us.ibm.com>
* tree-ssa-loop-ivcanon.c (try_peel_loop): Fix typo and remove dead
initialization.
Index: gcc/tree-ssa-loop-ivcanon.c
===================================================================
--- gcc/tree-ssa-loop-ivcanon.c (revision 264821)
+++ gcc/tree-ssa-loop-ivcanon.c (working copy)
@@ -1139,10 +1139,10 @@ try_peel_loop (struct loop *loop,
if (e->src != loop->latch)
{
if (e->src->count.initialized_p ())
- entry_count = e->src->count + e->src->count;
+ entry_count += e->src->count;
gcc_assert (!flow_bb_inside_loop_p (loop, e->src));
}
- profile_probability p = profile_probability::very_unlikely ();
+ profile_probability p;
p = entry_count.probability_in (loop->header->count);
scale_loop_profile (loop, p, 0);
bitmap_set_bit (peeled_loops, loop->num);