From: Jan Hubicka Date: Fri, 26 Sep 2025 13:57:03 +0000 (+0200) Subject: Fix precise 0 handling in afdo_propagate_edge X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=40d9e9601a1122749b21b98b4c88029b2402ecfc;p=thirdparty%2Fgcc.git Fix precise 0 handling in afdo_propagate_edge Currently afdo_propagate_edge will turn precise 0 to autofdo 0 because it thinks auto-profile claims some samples has been executed in the given basic block, while this is only a consequence of < being defined by 0 (predise) < 0 (autofdo) gcc/ChangeLog: * auto-profile.cc (afdo_propagate_edge): Fix handling of precize 0 counts. --- diff --git a/gcc/auto-profile.cc b/gcc/auto-profile.cc index 7d867de5bd9..e71689de308 100644 --- a/gcc/auto-profile.cc +++ b/gcc/auto-profile.cc @@ -3181,6 +3181,8 @@ afdo_propagate_edge (bool is_succ, bb_set *annotated_bb) changed = true; } else if (is_bb_annotated (bb, *annotated_bb) + /* We do not want to consider 0 (afdo) > 0 (precise) */ + && total_known_count.nonzero_p () && bb->count < total_known_count) { if (dump_file)