Handling of -march=native for recognised cores was broken by
r13-2937-g00c22ba69d8e73, which added "V" to ARCH_IDENT values and
filtered it out in some locations. This causes a lookup by stringified
ARCH_IDENT values to fail. If no -mtune or -mcpu option is used, then
we avoid this bug by upgrading -march=native to -mcpu=native.
Fix this by removing the '+ 1' string offset, so that the ident strings
match again. It would be marginally more efficient to use enum values
here, but I've stuck with this simpler fix instead.
gcc/ChangeLog:
PR target/124629
* config/aarch64/driver-aarch64.cc (AARCH64_ARCH):
Don't skip first character of #ARCH_IDENT.
gcc/testsuite/ChangeLog:
PR target/124629
* gcc.target/aarch64/cpunative/info_36: New test file.
* gcc.target/aarch64/cpunative/native_cpu_36.c: New test.
aarch64_feature_flags flags;
};
-/* Skip the leading "V" in the architecture name. */
#define AARCH64_ARCH(NAME, CORE, ARCH_IDENT, ARCH_REV, FLAGS) \
- { #ARCH_IDENT + 1, NAME, feature_deps::ARCH_IDENT ().enable },
+ { #ARCH_IDENT, NAME, feature_deps::ARCH_IDENT ().enable },
static constexpr const aarch64_arch_driver_info aarch64_arches[] =
{
--- /dev/null
+processor : 0
+BogoMIPS : 100.00
+Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 asimddp sve sve2 fphp asimdhp fcma
+CPU implementer : 0x41
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0xd08
+CPU revision : 2
+
--- /dev/null
+/* { dg-do compile { target { { aarch64*-*-linux*} && native } } } */
+/* { dg-set-compiler-env-var GCC_CPUINFO "$srcdir/gcc.target/aarch64/cpunative/info_36" } */
+/* { dg-additional-options "-march=native -mtune=cortex-a34" } */
+
+int main()
+{
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\.arch armv8-a\+dotprod\+crc\+crypto\+sve2\n} } } */