https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94465
Bug ID: 94465 Summary: [10 Regression] fnsplit dump file ICEs Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: tnfchris at gcc dot gnu.org Target Milestone: --- Created attachment 48179 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48179&action=edit c-decl.i The attached source ICEs when using `-c -o foo.o -Ofast -fdump-tree-fnsplit-all -w`. with c-decl.c:9540: internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in build_int_cst, at tree.c:1366 0x6cb76b tree_class_check_failed(tree_node const*, tree_code_class, char const*, int, char const*) ../../gcc-fsf/gcc/tree.c:9790 0x1119357 tree_class_check(tree_node*, tree_code_class, char const*, int, char const*) ../../gcc-fsf/gcc/tree.h:3401 0x1119357 build_int_cst(tree_node*, poly_int<2u, long>) ../../gcc-fsf/gcc/tree.c:1366 0x111a64b array_ref_low_bound(tree_node*) ../../gcc-fsf/gcc/tree.c:13429 0xed1d87 dump_generic_node(pretty_printer*, tree_node*, int, dump_flag, bool) ../../gcc-fsf/gcc/tree-pretty-print.c:2301 0xaa98e7 dump_unary_rhs ../../gcc-fsf/gcc/gimple-pretty-print.c:416 0xaa98e7 dump_gimple_assign ../../gcc-fsf/gcc/gimple-pretty-print.c:673 0xaab8d7 gimple_dump_bb_buff ../../gcc-fsf/gcc/gimple-pretty-print.c:2964 0xaab8d7 gimple_dump_bb(_IO_FILE*, basic_block_def*, int, dump_flag) ../../gcc-fsf/gcc/gimple-pretty-print.c:2988 0x8bedff dump_bb(_IO_FILE*, basic_block_def*, int, dump_flag) ../../gcc-fsf/gcc/cfghooks.c:286 0xe24ca3 dump_function_to_file(tree_node*, _IO_FILE*, dump_flag) ../../gcc-fsf/gcc/tree-cfg.c:8098 0xce70f7 execute_function_dump ../../gcc-fsf/gcc/passes.c:1750 0x1933813 diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*) ../../gcc-fsf/gcc/diagnostic.c:1142 0x1933be7 diagnostic_impl ../../gcc-fsf/gcc/diagnostic.c:1309 0x1934943 internal_error(char const*, ...) ../../gcc-fsf/gcc/diagnostic.c:1711 0x6cb76b tree_class_check_failed(tree_node const*, tree_code_class, char const*, int, char const*) ../../gcc-fsf/gcc/tree.c:9790 0x1119357 tree_class_check(tree_node*, tree_code_class, char const*, int, char const*) ../../gcc-fsf/gcc/tree.h:3401 0x1119357 build_int_cst(tree_node*, poly_int<2u, long>) ../../gcc-fsf/gcc/tree.c:1366 0x111a64b array_ref_low_bound(tree_node*) ../../gcc-fsf/gcc/tree.c:13429 0xed1d87 dump_generic_node(pretty_printer*, tree_node*, int, dump_flag, bool) ../../gcc-fsf/gcc/tree-pretty-print.c:2301 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. It looks like it's assuming the array offset is an integer constant but in this case it's an ssa_name: <array_ref 0xffffb7bace00 type <integer_type 0xffffb7baf5e8 int public SI size <integer_cst 0xffffb7b9efd8 constant 32> unit-size <integer_cst 0xffffb7bb3000 constant 4> align:32 warn_if_not_align:0 symtab:0 alias-set 3 canonical-type 0xffffb7baf5e8 precision:32 min <integer_cst 0xffffb7b9ef90 -2147483648> max <integer_cst 0xffffb7b9efa8 2147483647> pointer_to_this <pointer_type 0xffffb7bb7a80>> arg:0 <var_decl 0xffffb7ff52d0 x0 type <array_type 0xffffb79aac78 type <integer_type 0xffffb7baf5e8 int> BLK align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type 0xffffb79aac78 pointer_to_this <pointer_type 0xffffb79dbc78>> addressable used public external read BLK c-decl.i:1:8 align:32 warn_if_not_align:0 context <translation_unit_decl 0xffffb79de0f0 c-decl.i> chain <var_decl 0xffffb7ff5360 x6 type <integer_type 0xffffb7baf5e8 int> used public static read SI c-decl.i:9:1 size <integer_cst 0xffffb7b9efd8 32> unit-size <integer_cst 0xffffb7bb3000 4> align:32 warn_if_not_align:0 context <translation_unit_decl 0xffffb79de0f0 c-decl.i> chain <var_decl 0xffffb7ff53f0 x7>>> arg:1 <ssa_name 0xffffb7ba1480 type <error_mark 0xffffb7b9ed80> nothrow def_stmt version:3 in-free-list> when it's doing #3 0x000000000111a64c in array_ref_low_bound (exp=exp@entry=0xffffb7bace00) at ../../gcc-fsf/gcc/tree.c:13429 13429 return build_int_cst (TREE_TYPE (TREE_OPERAND (exp, 1)), 0); But I don't know what the correct fix here is.