https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122475
Bug ID: 122475
Summary: [16 Regression] RISC-V: ICE: Segmentation fault
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: ewlu at rivosinc dot com
Target Milestone: ---
Created attachment 62661
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62661&action=edit
freport-bug output
Testcase:
int a;
int b;
int main() {
for (char t = 0; t < 14; t += 2)
for (int u = 0; u < 242; u += 4) {
a = a < 0 ? a : 0;
b = b < 0 ? b : 0;
}
}
Command/backtrace:
$
/scratch/ewlu/daily-upstream-build/build-gcv/bin/riscv64-unknown-linux-gnu-gcc
-I/scratch/ewlu/ci/compiler-fuzz-ci/csmith-build/include -fsigned-char
-fno-strict-aliasing -fwrapv -march=rv64gcv -fwhole-program -O3 red.c -o
rv64gcv.out -w -freport-bug
during GIMPLE pass: vect
red.c: In function 'main':
red.c:3:5: internal compiler error: Segmentation fault
3 | int main() {
| ^~~~
0x30740a1 internal_error(char const*, ...)
../../../gcc/gcc/diagnostic-global-context.cc:787
0x1570533 crash_signal
../../../gcc/gcc/toplev.cc:323
0x7aa68fa4532f ???
./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x10e1955 contains_struct_check(tree_node const*, tree_node_structure_enum,
char const*, int, char const*)
../../../gcc/gcc/tree.h:4179
0x10e1955 operand_compare::operand_equal_p(tree_node const*, tree_node const*,
unsigned int)
../../../gcc/gcc/fold-const.cc:3214
0x10e1955 operand_equal_p(tree_node const*, tree_node const*, unsigned int)
../../../gcc/gcc/fold-const.cc:4357
0x1898fce vectorizable_reduction(_loop_vec_info*, _stmt_vec_info*, _slp_tree*,
_slp_instance*, vec<stmt_info_for_cost, va_heap, vl_ptr>*)
../../../gcc/gcc/tree-vect-loop.cc:7581
0x186ce9c vect_analyze_stmt(vec_info*, _slp_tree*, _slp_instance*,
vec<stmt_info_for_cost, va_heap, vl_ptr>*)
../../../gcc/gcc/tree-vect-stmts.cc:12881
0x18d26f0 vect_slp_analyze_node_operations_1
../../../gcc/gcc/tree-vect-slp.cc:8331
0x18d26f0 vect_slp_analyze_node_operations
../../../gcc/gcc/tree-vect-slp.cc:8600
0x18d2687 vect_slp_analyze_node_operations
../../../gcc/gcc/tree-vect-slp.cc:8577
0x18d2687 vect_slp_analyze_node_operations
../../../gcc/gcc/tree-vect-slp.cc:8577
0x18d2687 vect_slp_analyze_node_operations
../../../gcc/gcc/tree-vect-slp.cc:8577
0x18d46b1 vect_slp_analyze_operations(vec_info*)
../../../gcc/gcc/tree-vect-slp.cc:9004
0x188c380 vect_analyze_loop_2
../../../gcc/gcc/tree-vect-loop.cc:2321
0x188d627 vect_analyze_loop_1
../../../gcc/gcc/tree-vect-loop.cc:2788
0x188df6a vect_analyze_loop(loop*, gimple*, vec_info_shared*)
../../../gcc/gcc/tree-vect-loop.cc:2969
0x18eb349 try_vectorize_loop_1
../../../gcc/gcc/tree-vectorizer.cc:1096
0x18eb349 try_vectorize_loop
../../../gcc/gcc/tree-vectorizer.cc:1215
0x18ebb94 execute
../../../gcc/gcc/tree-vectorizer.cc:1331
Please submit a full bug report, with preprocessed source.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Preprocessed source stored into /tmp/ccsl1p1b.out file, please attach this to
your bugreport.
Godbolt: https://godbolt.org/z/67GvvE73q
Found via fuzzer