From bc468838ffa1991e50cb4b82b45154d44302417b Mon Sep 17 00:00:00 2001 From: zhenyu--zhao_admin 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 %