From: Jan Hubicka Date: Wed, 9 Jul 2025 16:30:09 +0000 (+0200) Subject: Fix ICE in afdo_adjust_guessed_profile X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=18324422fdd790b0c11ba300a706a86df1023b74;p=thirdparty%2Fgcc.git Fix ICE in afdo_adjust_guessed_profile gcc/ChangeLog: * auto-profile.cc (afdo_adjust_guessed_profile): Add forgotten if (dump_file) guard. --- diff --git a/gcc/auto-profile.cc b/gcc/auto-profile.cc index e27bcc7b58d..219676012e7 100644 --- a/gcc/auto-profile.cc +++ b/gcc/auto-profile.cc @@ -3613,9 +3613,13 @@ afdo_adjust_guessed_profile (bb_set *annotated_bb) of hot basic blocks. */ if (max_count * scale > max_count_in_fn.guessed_local ()) { - fprintf (dump_file, "Scaling by %.16f produces max count ", scale.to_double ()); - (max_count * scale).dump (dump_file); - fprintf (dump_file, " that exceeds max count in fn; capping\n"); + if (dump_file) + { + fprintf (dump_file, "Scaling by %.16f produces max count ", + scale.to_double ()); + (max_count * scale).dump (dump_file); + fprintf (dump_file, " that exceeds max count in fn; capping\n"); + } scale = max_count_in_fn.guessed_local ().to_sreal_scale (max_count); } scale_bbs (bbs, scale);