https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93238
Bug ID: 93238 Summary: [10 Regression] ICE in tree check: expected integer_cst, have mult_expr in to_wide, at tree.h:5855 since g:337ea6b216afd412 Product: gcc Version: 9.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: marxin at gcc dot gnu.org CC: jason at gcc dot gnu.org Target Milestone: --- It's reduced from 541.leela_r SPEC benchmark: $ cat 1.ii class A { public: short operator[](long); }; class B { enum { BLACK }; float m_fn1(); A m_neighbours; }; float B::m_fn1() { m_neighbours[0] >> 4 * BLACK; return 0.0f; } $ g++ 1.ii -c 1.ii: In member function 'float B::m_fn1()': 1.ii:11:26: internal compiler error: tree check: expected integer_cst, have mult_expr in to_wide, at tree.h:5860 11 | m_neighbours[0] >> 4 * BLACK; | ^~~~~ 0x815ae4 tree_check_failed(tree_node const*, char const*, int, char const*, ...) /home/marxin/Programming/gcc/gcc/tree.c:9685 0x818129 tree_check(tree_node const*, char const*, int, char const*, tree_code) /home/marxin/Programming/gcc/gcc/tree.h:3534 0x818129 wi::to_wide(tree_node const*) /home/marxin/Programming/gcc/gcc/tree.h:5860 0x818129 tree_int_cst_sgn(tree_node const*) /home/marxin/Programming/gcc/gcc/tree.c:7382 0xaebfa9 cp_build_binary_op(op_location_t const&, tree_code, tree_node*, tree_node*, int) /home/marxin/Programming/gcc/gcc/cp/typeck.c:5609 0x90ca37 build_new_op_1 /home/marxin/Programming/gcc/gcc/cp/call.c:6475 0x90d38d build_new_op(op_location_t const&, tree_code, int, tree_node*, tree_node*, tree_node*, tree_node**, int) /home/marxin/Programming/gcc/gcc/cp/call.c:6520 0xade183 build_x_binary_op(op_location_t const&, tree_code, tree_node*, tree_code, tree_node*, tree_code, tree_node**, int) /home/marxin/Programming/gcc/gcc/cp/typeck.c:4245 0xa0df91 cp_parser_binary_expression /home/marxin/Programming/gcc/gcc/cp/parser.c:9648 0xa0ee07 cp_parser_assignment_expression /home/marxin/Programming/gcc/gcc/cp/parser.c:9783 0xa0f0fd cp_parser_expression /home/marxin/Programming/gcc/gcc/cp/parser.c:9951 0xa128c8 cp_parser_expression_statement /home/marxin/Programming/gcc/gcc/cp/parser.c:11602 0xa1e3e9 cp_parser_statement /home/marxin/Programming/gcc/gcc/cp/parser.c:11398 0xa1fba2 cp_parser_statement_seq_opt /home/marxin/Programming/gcc/gcc/cp/parser.c:11745 0xa1fc78 cp_parser_compound_statement /home/marxin/Programming/gcc/gcc/cp/parser.c:11699 0xa383e5 cp_parser_function_body /home/marxin/Programming/gcc/gcc/cp/parser.c:22901 0xa383e5 cp_parser_ctor_initializer_opt_and_function_body /home/marxin/Programming/gcc/gcc/cp/parser.c:22952 0xa3b721 cp_parser_function_definition_after_declarator /home/marxin/Programming/gcc/gcc/cp/parser.c:28739 0xa3c4c1 cp_parser_function_definition_from_specifiers_and_declarator /home/marxin/Programming/gcc/gcc/cp/parser.c:28655 0xa3c4c1 cp_parser_init_declarator /home/marxin/Programming/gcc/gcc/cp/parser.c:20530 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.