https://gcc.gnu.org/g:fa5aedd841105329b2f65cb0ff418cb4427f255e

commit r13-9373-gfa5aedd841105329b2f65cb0ff418cb4427f255e
Author: Tamar Christina <tamar.christ...@arm.com>
Date:   Wed Feb 12 10:38:21 2025 +0000

    AArch64: Fix GCC 13 backport of big.Little CPU detection [PR118800]
    
    On the GCC-13 branch the backport caused a failure due to the branch not 
having
    generic-armv8-a and also it still treating the generic cpu special.  This 
made
    it return NULL when trying to find the default CPU.
    
    In GCC 13 we still had multiple structures with the same information and in 
this
    case aarch64_cpu_data was missing the generic CPU which is in all_cores.
    
    This corrects it by using "generc" instead and also adding it to
    aarch64_cpu_data.
    
    gcc/ChangeLog:
    
            PR target/118800
            * config/aarch64/driver-aarch64.cc (DEFAULT_CPU): Use generic 
instead of
            generic-armv8-a.
            (aarch64_cpu_data): Add generic.
    
    gcc/testsuite/ChangeLog:
    
            PR target/118800
            * gcc.target/aarch64/cpunative/native_cpu_34.c: Update order.

Diff:
---
 gcc/config/aarch64/driver-aarch64.cc                       | 3 ++-
 gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_34.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/gcc/config/aarch64/driver-aarch64.cc 
b/gcc/config/aarch64/driver-aarch64.cc
index ff4660f469cd..acc44536629e 100644
--- a/gcc/config/aarch64/driver-aarch64.cc
+++ b/gcc/config/aarch64/driver-aarch64.cc
@@ -60,7 +60,7 @@ struct aarch64_core_data
 #define ALL_VARIANTS ((unsigned)-1)
 /* Default architecture to use if -mcpu=native did not detect a known CPU.  */
 #define DEFAULT_ARCH "8A"
-#define DEFAULT_CPU "generic-armv8-a"
+#define DEFAULT_CPU "generic"
 
 #define AARCH64_CORE(CORE_NAME, CORE_IDENT, SCHED, ARCH, FLAGS, COSTS, IMP, 
PART, VARIANT) \
   { CORE_NAME, #ARCH, IMP, PART, VARIANT, feature_deps::cpu_##CORE_IDENT },
@@ -68,6 +68,7 @@ struct aarch64_core_data
 static CONSTEXPR const aarch64_core_data aarch64_cpu_data[] =
 {
 #include "aarch64-cores.def"
+  { "generic", "armv8-a", 0, 0, ALL_VARIANTS, 0},
   { NULL, NULL, INVALID_IMP, INVALID_CORE, ALL_VARIANTS, 0 }
 };
 
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_34.c 
b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_34.c
index 168140002a0f..d2ff8156d8fc 100644
--- a/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_34.c
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_34.c
@@ -7,6 +7,6 @@ int main()
   return 0;
 }
 
-/* { dg-final { scan-assembler {\.arch armv8-a\+dotprod\+crc\+crypto\+sve2\n} 
} } */
+/* { dg-final { scan-assembler {\.arch armv8-a\+crc\+dotprod\+crypto\+sve2\n} 
} } */
 
 /* Test a normal looking procinfo.  */

Reply via email to