From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EF058386EC08; Mon, 26 Jul 2021 18:42:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EF058386EC08 From: "cnsun at uwaterloo dot ca" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/101630] New: ICE with -Wall: in get_constant, at c-family/c-format.c:325 Date: Mon, 26 Jul 2021 18:42:22 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cnsun at uwaterloo dot ca X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jul 2021 18:42:23 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101630 Bug ID: 101630 Summary: ICE with -Wall: in get_constant, at c-family/c-format.c:325 Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: cnsun at uwaterloo dot ca Target Milestone: --- $ gcc-trunk -v Using built-in specs. COLLECT_GCC=3Dgcc-trunk COLLECT_LTO_WRAPPER=3D/scratch/software/gcc-trunk/libexec/gcc/x86_64-pc-lin= ux-gnu/12.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/configure --enable-languages=3Dc,c++,lto --enable-checking-yes --enable-multiarch --prefix=3D/scratch/software/gcc-trunk --disable-bootstrap Thread model: posix Supported LTO compression algorithms: zlib gcc version 12.0.0 20210726 (experimental) [master revision :c09cf6429:124bb55777c280a85d0c72ec13e293a32917a6b9] (GCC) $ cat mutant.c printf(char[][], ...) { printf(printf); } $ gcc-trunk -Wall mutant.c mutant.c:1:12: error: array type has incomplete element type =E2=80=98char[= ]=E2=80=99 1 | printf(char[][], ...) { printf(printf); } | ^ mutant.c:1:12: note: declaration of multidimensional array must have bounds= for all dimensions except the first mutant.c:1:1: warning: return type defaults to =E2=80=98int=E2=80=99 [-Wimp= licit-int] 1 | printf(char[][], ...) { printf(printf); } | ^~~~~~ mutant.c: In function =E2=80=98printf=E2=80=99: mutant.c:1:32: error: type of formal parameter 1 is incomplete 1 | printf(char[][], ...) { printf(printf); } | ^~~~~~ mutant.c:1:1: internal compiler error: in get_constant, at c-family/c-format.c:325 1 | printf(char[][], ...) { printf(printf); } | ^~~~~~ 0x675c97 get_constant /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/c-family/c-format.c:325 0x675c97 get_constant /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/c-family/c-format.c:313 0x9b061e decode_format_attr /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/c-family/c-format.c:377 0x9b2894 check_function_format(tree_node const*, tree_node*, int, tree_node= **, vec*) /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/c-family/c-format.c:1173 0x9a1c86 check_function_arguments(unsigned int, tree_node const*, tree_node const*, int, tree_node**, vec*) /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/c-family/c-common.c:5981 0x92a0eb build_function_call_vec(unsigned int, vec, tree_node*, vec*, vec*, tree_node*) /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/c/c-typeck.c:3195 0x94b27a c_parser_postfix_expression_after_primary /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/c/c-parser.c:10505 0x93bc65 c_parser_postfix_expression /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/c/c-parser.c:10178 0x946141 c_parser_unary_expression /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/c/c-parser.c:8224 0x94780f c_parser_cast_expression /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/c/c-parser.c:8066 0x947abf c_parser_binary_expression /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/c/c-parser.c:7869 0x948da8 c_parser_conditional_expression /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/c/c-parser.c:7592 0x949420 c_parser_expr_no_commas /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/c/c-parser.c:7507 0x9496b1 c_parser_expression /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/c/c-parser.c:10641 0x949e87 c_parser_expression_conv /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/c/c-parser.c:10680 0x95d2f3 c_parser_statement_after_labels /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/c/c-parser.c:6249 0x95f594 c_parser_compound_statement_nostart /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/c/c-parser.c:5788 0x95fc84 c_parser_compound_statement /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/c/c-parser.c:5597 0x961672 c_parser_declaration_or_fndef /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/c/c-parser.c:2539 0x968ff3 c_parser_external_declaration /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/c/c-parser.c:1777 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. Note that with -Wall, gcc-trunk also crashes though with a different stack trace. mutant.c:1:12: error: array type has incomplete element type =E2=80=98char[= ]=E2=80=99 1 | printf(char[][], ...) { printf(printf); } | ^ mutant.c:1:12: note: declaration of multidimensional array must have bounds= for all dimensions except the first mutant.c:1:1: warning: return type defaults to =E2=80=98int=E2=80=99 [-Wimp= licit-int] 1 | printf(char[][], ...) { printf(printf); } | ^~~~~~ mutant.c: In function =E2=80=98printf=E2=80=99: mutant.c:1:32: error: type of formal parameter 1 is incomplete 1 | printf(char[][], ...) { printf(printf); } | ^~~~~~ mutant.c:1:25: internal compiler error: tree check: expected class =E2=80= =98type=E2=80=99, have =E2=80=98exceptional=E2=80=99 (error_mark) in useless_type_conversion_p, at= gimple-expr.c:259 1 | printf(char[][], ...) { printf(printf); } | ^~~~~~ 0x7d0759 tree_class_check_failed(tree_node const*, tree_code_class, char const*, int, char const*) /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/tree.c:8736 0x6dd971 tree_class_check(tree_node*, tree_code_class, char const*, int, ch= ar const*) /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/tree.h:3496 0x6dd971 useless_type_conversion_p(tree_node*, tree_node*) /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/gimple-expr.c:259 0xc583d7 types_compatible_p /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/gimple-expr.h:67 0xc583d7 gimplify_addr_expr /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/gimplify.c:6235 0xc4adbf gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*= ), int) /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/gimplify.c:14270 0xc53ba9 gimplify_call_expr /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/gimplify.c:3454 0xc4b45f gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*= ), int) /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/gimplify.c:14195 0xc4dc6a gimplify_stmt(tree_node**, gimple**) /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/gimplify.c:6869 0xc4e49e gimplify_bind_expr /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/gimplify.c:1426 0xc4b47c gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*= ), int) /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/gimplify.c:14424 0xc4dc6a gimplify_stmt(tree_node**, gimple**) /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/gimplify.c:6869 0xc4f293 gimplify_body(tree_node*, bool) /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/gimplify.c:15456 0xc4f6e1 gimplify_function_tree(tree_node*) /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/gimplify.c:15610 0xaa2777 cgraph_node::analyze() /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/cgraphunit.c:670 0xaa5651 analyze_functions /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/cgraphunit.c:1234 0xaa6131 symbol_table::finalize_compilation_unit() /tmp/tmp.Tt2AkDfoq0-gcc-builder/gcc/gcc/cgraphunit.c:2508 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions.=