Bug 110880 - [14 Regression] aarch64 ICE on highway-1.0.5: internal compiler error: output_operand: incompatible floating point / vector register operand for '%s'
Summary: [14 Regression] aarch64 ICE on highway-1.0.5: internal compiler error: output...
Status: RESOLVED DUPLICATE of bug 109977
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 14.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-02 20:45 UTC by Sergei Trofimovich
Modified: 2023-08-02 20:48 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergei Trofimovich 2023-08-02 20:45:10 UTC
Don't know if a duplicate of PR109977 or not. FIling just in case. Initially observed ICE on `highway-1.0.5` against gcc r14-2930-g0460c122162793.

Extracted small example as:

// $ cat math_test.cc.cc
void CopyBytes(bool *from, float *to) { __builtin_memcpy(to, from, 4); }
int TestMath_d;
typedef __Float32x2_t float32x2_t;
struct Vec128 {
  Vec128(float32x2_t raw) : raw_(raw) {}
  float32x2_t raw_;
};
Vec128 NativeSet(float t) {
  float32x2_t __trans_tmp_2{t, t};
  return __trans_tmp_2;
}
Vec128 Set(float t) { return NativeSet(t); }
float BitCast_out;
bool TestMath_in[4];
void TestMath(int fxN(int, Vec128 &)) {
  CopyBytes(TestMath_in, &BitCast_out);
  Vec128 __trans_tmp_1 = Set(BitCast_out);
  fxN(TestMath_d, __trans_tmp_1);
}

$ aarch64-unknown-linux-gnu-stage-final-gcc-wrapper-14.0.0/bin/aarch64-unknown-linux-gnu-g++ -O2  -c math_test.cc.cc -o bug.o -O1

during RTL pass: final
math_test.cc.cc: In function 'void TestMath(int (*)(int, Vec128&))':
math_test.cc.cc:19:1: internal compiler error: output_operand: incompatible floating point / vector register operand for '%s'
   19 | }
      | ^
0x1c13274 diagnostic_impl(rich_location*, diagnostic_metadata const*, int, char const*, __va_list_tag (*) [1], diagnostic_t)
        ???:0
0x1c137e7 internal_error(char const*, ...)
        ???:0
0xb8b410 output_operand_lossage(char const*, ...)
        ???:0
0xb8b5d1 output_operand(rtx_def*, int)
        ???:0
0xb8c23d output_asm_insn(char const*, rtx_def**) [clone .part.0]
        ???:0
0xb8d564 final_scan_insn_1(rtx_insn*, _IO_FILE*, int, int, int*) [clone .isra.0]
        ???:0
0xb8d99b final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
        ???:0
0xb8dc37 final_1(rtx_insn*, _IO_FILE*, int, int)
        ???:0
0xb8e496 (anonymous namespace)::pass_final::execute(function*)
        ???:0
Comment 1 Sergei Trofimovich 2023-08-02 20:47:10 UTC
Compiler details:

$ aarch64-unknown-linux-gnu-g++ -v

Using built-in specs.
COLLECT_GCC=/<<NIX>>/aarch64-unknown-linux-gnu-stage-final-gcc-14.0.0/bin/aarch64-unknown-linux-gnu-g++
COLLECT_LTO_WRAPPER=/<<NIX>>/aarch64-unknown-linux-gnu-stage-final-gcc-14.0.0/libexec/gcc/aarch64-unknown-linux-gnu/14.0.0/lto-wrapper
Target: aarch64-unknown-linux-gnu
Configured with: ../source/configure --prefix=/<<NIX>>/aarch64-unknown-linux-gnu-stage-final-gcc-14.0.0 --with-gmp-include=/<<NIX>>/gmp-with-cxx-6.2.1-dev/include --with-gmp-lib=/<<NIX>>/gmp-with-cxx-6.2.1/lib --with-mpfr-include=/<<NIX>>/mpfr-4.2.0-dev/include --with-mpfr-lib=/<<NIX>>/mpfr-4.2.0/lib --with-mpc=/<<NIX>>/libmpc-1.3.1 --with-native-system-header-dir=/<<NIX>>/glibc-aarch64-unknown-linux-gnu-2.38-dev/include --with-build-sysroot=/ --program-prefix=aarch64-unknown-linux-gnu- --enable-lto --disable-libstdcxx-pch --without-included-gettext --with-system-zlib --enable-checking=release --enable-static --enable-languages=c,c++ --disable-multilib --enable-plugin --with-isl=/<<NIX>>/isl-0.20 --with-arch=armv8-a --with-as=/<<NIX>>/aarch64-unknown-linux-gnu-binutils-wrapper-2.41/bin/aarch64-unknown-linux-gnu-as --with-ld=/<<NIX>>/aarch64-unknown-linux-gnu-binutils-wrapper-2.41/bin/aarch64-unknown-linux-gnu-ld --with-headers=/<<NIX>>/glibc-aarch64-unknown-linux-gnu-2.38-dev/include --enable-__cxa_atexit --enable-long-long --enable-threads=posix --enable-nls --disable-bootstrap --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=aarch64-unknown-linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 99999999 (experimental) (GCC)
Comment 2 Andrew Pinski 2023-08-02 20:48:46 UTC
Yes it is a dup of bug 109977:
(insn:TI 14 11 21 (set (mem/c:V2SF (plus:DI (reg/f:DI 31 sp)
                (const_int 24 [0x18])) [1 __trans_tmp_1.raw_+0 S8 A64])
        (vec_duplicate:V2SF (reg:SF 2 x2 [orig:94 _7 ] [94]))) "/app/example.cpp":18:29 1391 {aarch64_simd_stpv2sf}
     (nil))

Here we have V2SF and in that one we had V2DF but the problem is the same. The use of the `vw` iterator in this pattern.
Comment 3 Andrew Pinski 2023-08-02 20:48:51 UTC
Yes it is a dup of bug 109977:
(insn:TI 14 11 21 (set (mem/c:V2SF (plus:DI (reg/f:DI 31 sp)
                (const_int 24 [0x18])) [1 __trans_tmp_1.raw_+0 S8 A64])
        (vec_duplicate:V2SF (reg:SF 2 x2 [orig:94 _7 ] [94]))) "/app/example.cpp":18:29 1391 {aarch64_simd_stpv2sf}
     (nil))

Here we have V2SF and in that one we had V2DF but the problem is the same. The use of the `vw` iterator in this pattern.

*** This bug has been marked as a duplicate of bug 109977 ***