https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115161
Bug ID: 115161 Summary: [15 Regression] highway-1.0.7 miscompilation of some SSE2 intrinsics Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: slyfox at gcc dot gnu.org Target Milestone: --- Created attachment 58250 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58250&action=edit bug.cc Initially observed at r15-656-ge1a7e2c54d52d0 on highway-1.0.7 where HwyConvertTestGroup/HwyConvertTest.TestAllF2IPromoteTo/SSE2 was failing as: [ RUN ] HwyConvertTestGroup/HwyConvertTest.TestAllF2IPromoteTo/SSE2 i64x2 expect [0+ ->]: 0x7fffffffffffffff,0x7fffffffffffffff, i64x2 actual [0+ ->]: 0x7fffffff00000000,0x7fffffff00000000, Abort at convert_test.cc:41: SSE2, i64x2 lane 0 mismatch: expected '0x7fffffffffffffff', got '0x7fffffff00000000'. I extracted it down to attached bug.cc. It's 5kb of straightforward self-contained code. Crashing: $ g++-15 bug.cc -o bug -O0 && ./bug exponent_adj(i): 0x00002000000020 0x00002000000020 adj_v(f): 0x4f8000004f800000 0x4f8000004f800000 lo64_or_mask(i): 0xffffffffffffffff 0xffffffffffffffff i(f): 0x5f8000005f800000 0x5f8000005f800000 expected(i): 0xffffffffffffffff 0xffffffffffffffff actual(i): 0xffffffffffffffff 0xffffffffffffffff Expected example: $ g++-15 bug.cc -o bug -O2 && ./bug exponent_adj(i): 0x00002000000020 0x00002000000020 adj_v(f): 0x4f8000004f800000 0x4f8000004f800000 lo64_or_mask(i): 0000000000000000 0000000000000000 i(f): 0x5f8000005f800000 0x5f8000005f800000 expected(i): 0xffffffffffffffff 0xffffffffffffffff actual(i): 0000000000000000 0000000000000000 Illegal instruction (core dumped) $ g++ -v Using built-in specs. COLLECT_GCC=/<<NIX>>/gcc-15.0.0/bin/g++ COLLECT_LTO_WRAPPER=/<<NIX>>/gcc-15.0.0/libexec/gcc/x86_64-unknown-linux-gnu/15.0.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../source/configure --prefix=/<<NIX>>/gcc-15.0.0 --with-gmp-include=/<<NIX>>/gmp-6.3.0-dev/include --with-gmp-lib=/<<NIX>>/gmp-6.3.0/lib --with-mpfr-include=/<<NIX>>/mpfr-4.2.1-dev/include --with-mpfr-lib=/<<NIX>>/mpfr-4.2.1/lib --with-mpc=/<<NIX>>/libmpc-1.3.1 --with-native-system-header-dir=/<<NIX>>/glibc-2.39-52-dev/include --with-build-sysroot=/ --with-gxx-include-dir=/<<NIX>>/gcc-15.0.0/include/c++/15.0.0/ --program-prefix= --enable-lto --disable-libstdcxx-pch --without-included-gettext --with-system-zlib --enable-checking=release --enable-static --enable-languages=c,c++ --disable-multilib --enable-plugin --disable-libcc1 --with-isl=/<<NIX>>/isl-0.20 --disable-bootstrap --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=x86_64-unknown-linux-gnu Thread model: posix Supported LTO compression algorithms: zlib gcc version 15.0.0 99999999 (experimental) (GCC)