From 0f9ad7544d05ac2dca55991b9517bfccfe14ef04 Mon Sep 17 00:00:00 2001 From: liyancheng <412998149@qq.com> Date: Thu, 6 Jun 2024 22:10:59 +0800 Subject: [PATCH] [AutoFDO] avoid accessing dump_file null pointer --- gcc/tree-ssa-loop-unswitch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/tree-ssa-loop-unswitch.c b/gcc/tree-ssa-loop-unswitch.c index 2a380255c..20f9ac95f 100644 --- a/gcc/tree-ssa-loop-unswitch.c +++ b/gcc/tree-ssa-loop-unswitch.c @@ -858,7 +858,8 @@ hoist_guard (class loop *loop, edge guard) if (skip_count > e->count ()) { - fprintf (dump_file, " Capping count; expect profile inconsistency\n"); + if (dump_file) + fprintf (dump_file, " Capping count; expect profile inconsistency\n"); skip_count = e->count (); } if (dump_file && (dump_flags & TDF_DETAILS)) -- 2.33.0