https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98726
Bug ID: 98726 Summary: aarch64: tree check: expected integer_cst, have poly_int_cst in to_wide, at tree.h:5984 Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: acoplan at gcc dot gnu.org Target Milestone: --- The following fails: $ cat test.c int a, c; char b; int d() { a = 0; for (; a <= 21; a = (short)a + 1) b &= c; } $ aarch64-elf-gcc -c test.c -O3 -march=armv8.2-a+sve during GIMPLE pass: forwprop test.c: In function 'd': test.c:3:5: internal compiler error: tree check: expected integer_cst, have poly_int_cst in to_wide, at tree.h:5984 3 | int d() { | ^ 0x1161f66 tree_check_failed(tree_node const*, char const*, int, char const*, ...) /home/alecop01/toolchain/src/gcc/gcc/tree.c:9812 0x7393c1 tree_check(tree_node const*, char const*, int, char const*, tree_code) /home/alecop01/toolchain/src/gcc/gcc/tree.h:3594 0x7393c1 wi::to_wide(tree_node const*) /home/alecop01/toolchain/src/gcc/gcc/tree.h:5984 0x1177e1d vector_cst_int_elt(tree_node const*, unsigned int) /home/alecop01/toolchain/src/gcc/gcc/tree.c:11104 0x11935a3 vector_cst_elt(tree_node const*, unsigned int) /home/alecop01/toolchain/src/gcc/gcc/tree.c:11131 0xa35b48 const_binop(tree_code, tree_node*, tree_node*, tree_node*) /home/alecop01/toolchain/src/gcc/gcc/fold-const.c:1644 0x1484144 gimple_resimplify2 /home/alecop01/toolchain/src/gcc/gcc/gimple-match-head.c:276 0x14b3ca2 gimple_simplify(gimple*, gimple_match_op*, gimple**, tree_node* (*)(tree_node*), tree_node* (*)(tree_node*)) /home/alecop01/toolchain/src/gcc/gcc/gimple-match-head.c:957 0xa9c5d1 fold_stmt_1 /home/alecop01/toolchain/src/gcc/gcc/gimple-fold.c:6016 0xa9ef9b fold_stmt(gimple_stmt_iterator*, tree_node* (*)(tree_node*)) /home/alecop01/toolchain/src/gcc/gcc/gimple-fold.c:6254 0xf73a2a execute /home/alecop01/toolchain/src/gcc/gcc/tree-ssa-forwprop.c:3108 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions.