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

--- Comment #4 from David Spickett <david.spickett at linaro dot org> ---
I've been fixing this for clang so here is a test file in case it's any help.

gcc version 11.0.0 20200609 (experimental)
Ubuntu 16.04.7 LTS running on x86_64

$ ./aarch64-none-elf-g++ -v
Using built-in specs.
COLLECT_GCC=./aarch64-none-elf-g++
COLLECT_LTO_WRAPPER=/arm/pdtl/builds/fsf-trunk.2226/installed/rhe6x86_64/aarch64-none-elf/bin/../libexec/gcc/aarch64-none-elf/11.0.0/lto-wrapper
Target: aarch64-none-elf
Configured with:
/tmp/dgboter/bbs/rhev-vm4--rhe6x86_64/buildbot/rhe6x86_64--aarch64-none-elf/build/src/gcc/configure
--target=aarch64-none-elf
--prefix=/tmp/dgboter/bbs/rhev-vm4--rhe6x86_64/buildbot/rhe6x86_64--aarch64-none-elf/build/build-aarch64-none-elf/install//
--with-gmp=/tmp/dgboter/bbs/rhev-vm4--rhe6x86_64/buildbot/rhe6x86_64--aarch64-none-elf/build/build-aarch64-none-elf/host-tools
--with-mpfr=/tmp/dgboter/bbs/rhev-vm4--rhe6x86_64/buildbot/rhe6x86_64--aarch64-none-elf/build/build-aarch64-none-elf/host-tools
--with-mpc=/tmp/dgboter/bbs/rhev-vm4--rhe6x86_64/buildbot/rhe6x86_64--aarch64-none-elf/build/build-aarch64-none-elf/host-tools
--with-isl=/tmp/dgboter/bbs/rhev-vm4--rhe6x86_64/buildbot/rhe6x86_64--aarch64-none-elf/build/build-aarch64-none-elf/host-tools
--disable-shared --disable-nls --disable-threads --disable-tls
--enable-checking=yes --enable-languages=c,c++,fortran --with-newlib
--with-pkgversion=fsf-trunk.2226
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 11.0.0 20200609 (experimental) (fsf-trunk.2226)

/tmp/test.cpp:
#include <arm_neon.h>

uint32_t (*fp3)(int64_t) = vqmovund_s64;
uint8_t (*fp4)(int16_t) = vqmovunh_s16;
uint16_t (*fp5)(int32_t) = vqmovuns_s32;

Compile with:
$ ./aarch64-none-elf-g++ -march=armv8.1-a+simd -Wall -Wextra -c -o /tmp/foo
/tmp/test.cpp -save-temps

Output:
/tmp/test.cpp:3:28: error: invalid conversion from 'int32_t (*)(int64_t)' {aka
'int (*)(long int)'} to 'uint32_t (*)(int64_t)' {aka 'unsigned int (*)(long
int)'} [-fpermissive]
    3 | uint32_t (*fp3)(int64_t) = vqmovund_s64;
      |                            ^~~~~~~~~~~~
      |                            |
      |                            int32_t (*)(int64_t) {aka int (*)(long int)}
/tmp/test.cpp:4:27: error: invalid conversion from 'int8_t (*)(int16_t)' {aka
'signed char (*)(short int)'} to 'uint8_t (*)(int16_t)' {aka 'unsigned char
(*)(short int)'} [-fpermissive]
    4 | uint8_t (*fp4)(int16_t) = vqmovunh_s16;
      |                           ^~~~~~~~~~~~
      |                           |
      |                           int8_t (*)(int16_t) {aka signed char
(*)(short int)}
/tmp/test.cpp:5:28: error: invalid conversion from 'int16_t (*)(int32_t)' {aka
'short int (*)(int)'} to 'uint16_t (*)(int32_t)' {aka 'short unsigned int
(*)(int)'} [-fpermissive]
    5 | uint16_t (*fp5)(int32_t) = vqmovuns_s32;
      |                            ^~~~~~~~~~~~
      |                            |
      |                            int16_t (*)(int32_t) {aka short int
(*)(int)}

Reply via email to