https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118800

            Bug ID: 118800
           Summary: [13.3.1 regression] aarch64 -mcpu=native ICEs since
                    PR113257 backport
           Product: gcc
           Version: 13.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mikpelinux at gmail dot com
  Target Milestone: ---

Created attachment 60426
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60426&action=edit
/proc/cpuinfo from the M1

gcc-13-20250207 built on aarch64-linux-gnu ICEs when -mcpu=native is used:

> gcc/xgcc -Bgcc -S -o /dev/null -x c /dev/null -mcpu=native
xgcc: internal compiler error: in host_detect_local_cpu, at
config/aarch64/driver-aarch64.cc:461
0x415baf host_detect_local_cpu(int, char const**)
        /mnt/scratch/gcc-13-20250207/gcc/config/aarch64/driver-aarch64.cc:461
0x40f6bf eval_spec_function
        /mnt/scratch/gcc-13-20250207/gcc/gcc.cc:6896
0x40f6bf handle_spec_function
        /mnt/scratch/gcc-13-20250207/gcc/gcc.cc:6977
0x40e67f do_spec_1
        /mnt/scratch/gcc-13-20250207/gcc/gcc.cc:6665
0x4102a7 process_brace_body
        /mnt/scratch/gcc-13-20250207/gcc/gcc.cc:7345
0x4102a7 handle_braces
        /mnt/scratch/gcc-13-20250207/gcc/gcc.cc:7252
0x40dfe7 do_spec_1
        /mnt/scratch/gcc-13-20250207/gcc/gcc.cc:6659
0x40f123 do_spec_2
        /mnt/scratch/gcc-13-20250207/gcc/gcc.cc:5713
0x41070b do_self_spec
        /mnt/scratch/gcc-13-20250207/gcc/gcc.cc:5777
0x413527 driver::set_up_specs() const
        /mnt/scratch/gcc-13-20250207/gcc/gcc.cc:8351
0x403c03 driver::main(int, char**)
        /mnt/scratch/gcc-13-20250207/gcc/gcc.cc:8111
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Noticed because the test suite showed a regression since gcc-13-20250124:

+FAIL: gcc.target/aarch64/cpunative/native_cpu_16.c (test for excess errors)
+UNRESOLVED: gcc.target/aarch64/cpunative/native_cpu_16.c scan-assembler
\\\\.arch armv8-a\\\\+crc\\\\+dotprod\\\\+crypto\\\\+sve2
+FAIL: gcc.target/aarch64/cpunative/native_cpu_17.c (test for excess errors)
+UNRESOLVED: gcc.target/aarch64/cpunative/native_cpu_17.c scan-assembler
\\\\.arch armv8-a\\\\+crc\\\\+dotprod\\\\+crypto\\\\+sve2
+FAIL: gcc.target/aarch64/cpunative/native_cpu_34.c (internal compiler error:
in host_detect_local_cpu, at config/aarch64/driver-aarch64.cc:461)
+FAIL: gcc.target/aarch64/cpunative/native_cpu_34.c (test for excess errors)
+UNRESOLVED: gcc.target/aarch64/cpunative/native_cpu_34.c scan-assembler
\\\\.arch armv8-a\\\\+dotprod\\\\+crc\\\\+crypto\\\\+sve2\\\\n
+FAIL: gcc.target/aarch64/cpunative/native_cpu_35.c (internal compiler error:
in host_detect_local_cpu, at config/aarch64/driver-aarch64.cc:461)
+UNRESOLVED: gcc.target/aarch64/cpunative/native_cpu_35.c scan-assembler
\\\\.arch armv8.8-a\\\\+crc\\\\+sve\\\\n

Reverting the PR113257 backport to gcc-13 in
eb45b829bb3fb658aa34a340264dee9755d34e69 fixes the issue. As -mcpu=native works
in gcc-14/15 I assume the backport depends on something which hasn't been
backported to gcc-13.

The host is aarch64-linux-gnu, an Apple M1 running Fedora 41 (Asahi spin).

Full configuration options:
/mnt/scratch/gcc-13-20250207/configure --enable-languages=c,ada,c++,d,m2
--enable-shared --enable-treads=posix --enable-checking=release
--enable-multilib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-gnu-unique-object --enable-linker-build-id
--with-linker-hash-style=gnu --disable-plugin --enable-initfini-array
--enable-gnu-indirect-function --build=aarch64-unknown-linux-gnu
--prefix=/mnt/scratch/install13
--with-gmp=/home/mikpe/pkgs/linux-aarch64/gmp-6.3.0
--with-mpfr=/home/mikpe/pkgs/linux-aarch64/mpfr-4.2.1
--with-mpc=/home/mikpe/pkgs/linux-aarch64/mpc-1.3.1 --without-isl --disable-lto
--disable-nls --disable-libmudflap --enable-libsanitizer

Reply via email to