https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127116
Bug ID: 127116
Summary: [17 Regression] ICE: verify_gimple failed during
GIMPLE pass: slp (type mismatch in binary expression)
with unlimited cost model
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: bouncy12578 at gmail dot com
Target Milestone: ---
Created attachment 65439
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=65439&action=edit
reduced code triggering the crash
Godbolt: https://godbolt.org/z/f6Mx8bGdf
Known to fail: 17
Known to work: 16.2
Compiler version:
COLLECT_GCC=/opt/compiler-explorer/gcc-snapshot/bin/gcc
COLLECT_LTO_WRAPPER=/cefs/a5/a5f96cbe45380d22d99d6728_gcc-trunk-20260827/bin/../libexec/gcc/x86_64-linux-gnu/17.0.0/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../gcc-trunk-20260827/configure
--prefix=/opt/compiler-explorer/gcc-build/staging --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu --disable-bootstrap
--enable-multiarch --with-abi=m64 --with-multilib-list=m32,m64,mx32
--enable-multilib --enable-clocale=gnu
--enable-languages=c,c++,fortran,ada,objc,obj-c++,go,d,rust,m2,cobol,algol68
--enable-ld=yes --enable-gold=yes --enable-libstdcxx-time=yes
--enable-linker-build-id --enable-lto --enable-plugins --enable-threads=posix
--with-pkgversion=Compiler-Explorer-Build-gcc-171a47f62d5a59f6b0d96ae5d5777279cc2009db-binutils-2.44
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 17.0.0 20260827 (experimental)
Command line used:
gcc -fvect-cost-model=unlimited -O3 random.c
Code to reproduce:
typedef char h;
typedef short i;
typedef int j;
typedef i k;
typedef j l;
typedef h m;
k(n)(k left, int o) { return left >> o; }
m(p)(m q, m r) { return q * r; }
struct a {
k b;
unsigned c;
} volatile d;
struct a e;
struct a f;
l g(l ab) {
k ac = 1;
for (ab = -4; ab; ++ab) {
k *ad = ∾
k *ae = &e.b;
*ae |= n(*ad, d.b) >= (p(f.c, ab) == 6);
}
}
Compiler output:
<source>: In function 'g':
<source>:15:3: error: type mismatch in binary expression
15 | l g(l ab) {
| ^
vector(4) <signed-boolean:8>
vector(4) <signed-boolean:16>
vector(4) <signed-boolean:8>
mask_patt_22.19_39 = mask_patt_29.18_51 | mask_patt_22.19_50;
during GIMPLE pass: slp
<source>:15:3: internal compiler error: verify_gimple failed
0x28418b8 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
???:0
0x28364fb internal_error(char const*, ...)
???:0
0x12738ae verify_gimple_in_cfg(function*, bool, bool)
???:0
/cefs/a5/a5f96cbe45380d22d99d6728_gcc-trunk-20260827/bin/../libexec/gcc/x86_64-linux-gnu/17.0.0/cc1
-quiet -imultiarch x86_64-linux-gnu -iprefix
/cefs/a5/a5f96cbe45380d22d99d6728_gcc-trunk-20260827/bin/../lib/gcc/x86_64-linux-gnu/17.0.0/
<source> -quiet -dumpdir /app/output.s- -dumpbase example.c -dumpbase-ext .c
-mtune=generic -march=x86-64 -g -O3 -fdiagnostics-color=always -fno-verbose-asm
-fvect-cost-model=unlimited -o /tmp/ccosg0RG.s
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.