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

            Bug ID: 115732
           Summary: Arm32 architecture definitions for v8+ appear to have
                    wrong FPU/SIMD defaults
           Product: gcc
           Version: 14.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: driver
          Assignee: unassigned at gcc dot gnu.org
          Reporter: alex at alexrp dot com
  Target Milestone: ---

To my eye, it appears that GCC's architecture definitions in
`gcc/config/arm/arm-cpus.in` are incomplete for Arm v8+. These all have a
`nofp` option but no `fp` option, strongly indicating that the intent is for
them to have an FPU by default, which would make sense for v8+.

It's also worth noting that LLVM's definitions for these Arm versions include
FPU/SIMD:
https://github.com/llvm/llvm-project/blob/a8e1c3e1239604ac787b6a2d39b5278ddec8aa8a/llvm/lib/Target/ARM/ARMArchitectures.td#L85-L95

Unfortunately, this doesn't seem to be working as intended:

    $ ./prefix/armv8a-linux-gnueabihf/bin/armv8a-linux-gnueabihf-gcc
-march=armv8-a -mfloat-abi=hard empty.c -c
    cc1: error: ‘-mfloat-abi=hard’: selected architecture lacks an FPU

And due to the lack of an `fp` option, the obvious thing doesn't work:

    $ ./prefix/armv8a-linux-gnueabihf/bin/armv8a-linux-gnueabihf-gcc
-march=armv8-a+fp -mfloat-abi=hard empty.c -c
    armv8a-linux-gnueabihf-gcc: error: ‘armv8-a’ does not support feature ‘fp’
    armv8a-linux-gnueabihf-gcc: note: valid feature names are: crc simd crypto
nocrypto nofp sb predres; did you mean ‘nofp’?
    armv8a-linux-gnueabihf-gcc: error: ‘armv8-a’ does not support feature ‘fp’
    armv8a-linux-gnueabihf-gcc: note: valid feature names are: crc simd crypto
nocrypto nofp sb predres; did you mean ‘nofp’?

This does, but again, seems suspect because SIMD probably ought to be default?:

    $ ./prefix/armv8a-linux-gnueabihf/bin/armv8a-linux-gnueabihf-gcc
-march=armv8-a+simd -mfloat-abi=hard empty.c -c

The same issue occurs for every architecture definition after v8 (v8.1, v8.2,
etc).

GCC configuration:

    $ Using built-in specs.
    COLLECT_GCC=./prefix/armv8a-linux-gnueabihf/bin/armv8a-linux-gnueabihf-gcc
   
COLLECT_LTO_WRAPPER=/home/alexrp/Source/gcc/prefix/armv8a-linux-gnueabihf/libexec/gcc/armv8a-linux-gnueabihf/14.1.0/lto-wrapper
    Target: armv8a-linux-gnueabihf
    Configured with: ../configure --build=x86_64-cross-linux-gnu
--target=armv8a-linux-gnueabihf
--prefix=/home/alexrp/Source/gcc/prefix/armv8a-linux-gnueabihf
--program-prefix=armv8a-linux-gnueabihf-
--with-gxx-include-dir=/home/alexrp/Source/gcc/prefix/armv8a-linux-gnueabihf/sysroot/usr/include/c++
--with-sysroot=/home/alexrp/Source/gcc/prefix/armv8a-linux-gnueabihf/sysroot
--with-system-readline --with-system-zlib
--with-toolexeclibdir=/home/alexrp/Source/gcc/prefix/armv8a-linux-gnueabihf/sysroot/usr/lib
--enable-host-bind-now --enable-host-pie --enable-multiarch --disable-multilib
--enable-obsolete --with-arch=armv8-a --enable-languages=c,c++,jit
--enable-host-shared
    Thread model: posix
    Supported LTO compression algorithms: zlib zstd
    gcc version 14.1.0 (GCC)

Reply via email to