https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112733
Bug ID: 112733 Summary: [14 Regression] ICE: Segmentation fault in wide-int.cc during GIMPLE pass: sccp Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: patrick at rivosinc dot com Target Milestone: --- Reconfirmed using r14-5889-gc9d691a7daa. This has not been bisected. Using godbolt to check - this is broken on trunk x86, arm, riscv. Regression from 13.2 where this compiles on x86, arm, riscv. > cat red.c char a, c; short b; void d() { signed char *e = &a; c = 0 != d; *e &= c; for (; b; --b) *e &= 128; } > /scratch/tc-testing/tc-nov-27-trunk/build-rv64gcv/bin/riscv64-unknown-linux-gnu-gcc > red.c -S -O2 -freport-bug during GIMPLE pass: sccp red.c: In function 'd': red.c:3:6: internal compiler error: Segmentation fault 3 | void d() { | ^ 0x12884a3 crash_signal ../../../gcc/gcc/toplev.cc:316 0x7fb10de4251f ??? ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 0x163ac0e wi_pack ../../../gcc/gcc/wide-int.cc:1303 0x1642d17 wi::divmod_internal(long*, unsigned int*, long*, long const*, unsigned int, unsigned int, long const*, unsigned int, unsigned int, signop, wi::overflow_type*) ../../../gcc/gcc/wide-int.cc:1988 0xecaf5c wi::binary_traits<generic_wide_int<wi::extended_tree<131072> >, generic_wide_int<wi::extended_tree<131072> >, wi::int_traits<generic_wide_int<wi::extended_tree<131072> > >::precision_type, wi::int_traits<generic_wide_int<wi::extended_tree<131072> > >::precision_type>::result_type wi::mod_trunc<generic_wide_int<wi::extended_tree<131072> >, generic_wide_int<wi::extended_tree<131072> > >(generic_wide_int<wi::extended_tree<131072> > const&, generic_wide_int<wi::extended_tree<131072> > const&, signop, wi::overflow_type*) ../../../gcc/gcc/wide-int.h:3382 0xeac199 bool wi::multiple_of_p<generic_wide_int<wi::extended_tree<131072> >, generic_wide_int<wi::extended_tree<131072> > >(generic_wide_int<wi::extended_tree<131072> > const&, generic_wide_int<wi::extended_tree<131072> > const&, signop) ../../../gcc/gcc/wide-int.h:3549 0xeac199 multiple_of_p(tree_node*, tree_node const*, tree_node const*, bool) ../../../gcc/gcc/fold-const.cc:14554 riscv64-unknown-linux-gnu-gcc: internal compiler error: Segmentation fault signal terminated program cc1 Please submit a full bug report, with preprocessed source. See <https://gcc.gnu.org/bugs/> for instructions. -freport bug does not seem to be working for me so here's the -v output: > /scratch/tc-testing/tc-nov-27-trunk/build-rv64gcv/bin/riscv64-unknown-linux-gnu-gcc > -v Using built-in specs. COLLECT_GCC=/scratch/tc-testing/tc-nov-27-trunk/build-rv64gcv/bin/riscv64-unknown-linux-gnu-gcc COLLECT_LTO_WRAPPER=/scratch/tc-testing/tc-nov-27-trunk/build-rv64gcv/libexec/gcc/riscv64-unknown-linux-gnu/14.0.0/lto-wrapper Target: riscv64-unknown-linux-gnu Configured with: /scratch/tc-testing/tc-nov-27-trunk/build-rv64gcv/../gcc/configure --target=riscv64-unknown-linux-gnu --prefix=/scratch/tc-testing/tc-nov-27-trunk/build-rv64gcv --with-sysroot=/scratch/tc-testing/tc-nov-27-trunk/build-rv64gcv/sysroot --with-pkgversion=gc9d691a7daa --with-system-zlib --enable-shared --enable-tls --enable-languages=c,c++,fortran --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libsanitizer --disable-nls --disable-bootstrap --src=../../gcc --enable-multilib --with-abi=lp64d --with-arch=rv64imafdc --with-tune=rocket --with-isa-spec=20191213 'CFLAGS_FOR_TARGET=-O2 -mcmodel=medlow' 'CXXFLAGS_FOR_TARGET=-O2 -mcmodel=medlow' Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 14.0.0 20231127 (experimental) (gc9d691a7daa)