summaryrefslogtreecommitdiff
path: root/0317-Bugfix-set-default-value-when-tune_native-is-NULL.patch
blob: 92f10c2bcd9ec686820fd45abe2bac6dda64bddc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From bc468838ffa1991e50cb4b82b45154d44302417b Mon Sep 17 00:00:00 2001
From: zhenyu--zhao_admin <zhaozhenyu17@huawei.com>
Date: Tue, 3 Dec 2024 22:39:36 +0800
Subject: [PATCH 5/5] Bugfix: set default value when tune_native is NULL.

---
 gcc/gcc.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 0032735db..90f6dfe85 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -5800,6 +5800,10 @@ do_self_spec (const char *spec)
   do_spec_1 (" ", 0, NULL);
 
   const char* tune_native = eval_spec_function ("local_cpu_detect", "cpu", "");
+  if (tune_native == NULL)
+    {
+      tune_native = "native";
+    }
   setenv ("GCC_AI4C_TUNE_INFO", tune_native, 1);
 
   /* Mark %<S switches processed by do_self_spec to be ignored permanently.
-- 
2.33.0