[Bugfix] Fix accessing dump_file null ptr when do autofdo

Sync from openeuler/gcc
This commit is contained in:
liyancheng 2024-06-07 17:03:23 +08:00
parent 16167f6ec3
commit 4ee65657f0
2 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,26 @@
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

View File

@ -61,7 +61,7 @@
Summary: Various compilers (C, C++, Objective-C, ...)
Name: gcc
Version: %{gcc_version}
Release: 55
Release: 56
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
URL: https://gcc.gnu.org
@ -301,6 +301,7 @@ Patch190: 0190-sync-LLC-difference-between-source-and-patch-code.patch
Patch191: 0191-LLC-Allocation-Bugfix-Fix-ambiguous-reference-due-to.patch
Patch192: 0192-Add-feedback-directed-filter_and_sort_kernels-in-Pha.patch
Patch193: 0193-Add-prefetch-level-parameter-to-specify-the-last-lev.patch
Patch194: 0194-AutoFDO-avoid-accessing-dump_file-null-pointer.patch
%global gcc_target_platform %{_arch}-linux-gnu
@ -947,6 +948,7 @@ not stable, so plugins must be rebuilt any time GCC is updated.
%patch191 -p1
%patch192 -p1
%patch193 -p1
%patch194 -p1
%build
@ -2981,6 +2983,12 @@ end
%doc rpm.doc/changelogs/libcc1/ChangeLog*
%changelog
* Fri Jun 7 2024 liyancheng <412998149@qq.com> - 10.3.1-56
- Type:BUGFIX
- ID:NA
- SUG:NA
- DESC: avoid accessing dump_file null pointer
* Wed May 29 2024 yzyssdd <yuzeyang4@huawei.com> - 10.3.1-55
- Type:SPEC
- ID:NA