From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ABC1D3858C74; Sun, 23 Apr 2023 02:56:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ABC1D3858C74 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682218592; bh=2OjZzqWPdpyT/leqGjF/Ymwl8g2tMZ5mhkArvSo39bI=; h=From:To:Subject:Date:From; b=AgJz5w507AG8QJDm/G29F6133xAKP99wlm9FykcdxUBGXG4X1JSQbUZ5in04gAWSd 7EI19ONmzzypdzBNPuI/umvMNbEYzG8yEUlV8y4WbiVR4jLAY9Vhwjs8TKjNLm3BHB h77BFuV6wvd6rlYiY6SA8pPcMr6PBW7AGkrvYG6M= From: "anbu1024.me at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/109598] New: ICE: tree check: expected array_type, have error_mark in array_ref_low_bound, at tree.cc Date: Sun, 23 Apr 2023 02:56:32 +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: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: anbu1024.me at gmail dot com 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109598 Bug ID: 109598 Summary: ICE: tree check: expected array_type, have error_mark in array_ref_low_bound, at tree.cc Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: anbu1024.me at gmail dot com Target Milestone: --- gcc (GCC) 13.0.1 20230219 snapshot ICEs when compiling the following testca= se $ gcc --version gcc (GCC) 13.0.1 20230219 (experimental) Copyright (C) 2023 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -------------------------------- $ cat 2.c extern char g[]; char *foo(void) { return &g[0]; } char *g(void) { return &g[1]; } -------------------------------- $ gcc 2.c=20 2.c:9:7: error: =E2=80=98g=E2=80=99 redeclared as different kind of symbol 9 | char *g(void) | ^ 2.c:2:13: note: previous declaration of =E2=80=98g=E2=80=99 with type =E2= =80=98char[]=E2=80=99 2 | extern char g[]; | ^ 2.c: In function =E2=80=98g=E2=80=99: 2.c:11:12: error: subscripted value is neither array nor pointer nor vector 11 | return &g[1]; | ^ 2.c: In function =E2=80=98foo=E2=80=99: 2.c:6:12: internal compiler error: tree check: expected array_type, have error_mark in array_ref_low_bound, at tree.cc:12782 6 | return &g[0]; | ~^~~ 0x840178 tree_check_failed(tree_node const*, char const*, int, char const*, ...) ../../gcc-13-20230219/gcc/tree.cc:8909 0x8499ae tree_check(tree_node*, char const*, int, char const*, tree_code) ../../gcc-13-20230219/gcc/tree.h:3530 0x8499ae array_ref_low_bound(tree_node*) ../../gcc-13-20230219/gcc/tree.cc:12782 0xc8caf9 gimplify_compound_lval ../../gcc-13-20230219/gcc/gimplify.cc:3219 0xc875fe gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*= ), int) ../../gcc-13-20230219/gcc/gimplify.cc:16313 0xc8e602 gimplify_addr_expr ../../gcc-13-20230219/gcc/gimplify.cc:6561 0xc8805d gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*= ), int) ../../gcc-13-20230219/gcc/gimplify.cc:16408 0xc9a465 gimplify_modify_expr ../../gcc-13-20230219/gcc/gimplify.cc:6153 0xc879e1 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*= ), int) ../../gcc-13-20230219/gcc/gimplify.cc:16361 0xc8a316 gimplify_stmt(tree_node**, gimple**) ../../gcc-13-20230219/gcc/gimplify.cc:7219 0xc96670 gimplify_and_add(tree_node*, gimple**) ../../gcc-13-20230219/gcc/gimplify.cc:492 0xc96670 gimplify_return_expr ../../gcc-13-20230219/gcc/gimplify.cc:1680 0xc87d0a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*= ), int) ../../gcc-13-20230219/gcc/gimplify.cc:16623 0xc8a316 gimplify_stmt(tree_node**, gimple**) ../../gcc-13-20230219/gcc/gimplify.cc:7219 0xc8aa47 gimplify_bind_expr ../../gcc-13-20230219/gcc/gimplify.cc:1430 0xc87c95 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*= ), int) ../../gcc-13-20230219/gcc/gimplify.cc:16562 0xca912e gimplify_stmt(tree_node**, gimple**) ../../gcc-13-20230219/gcc/gimplify.cc:7219 0xca912e gimplify_body(tree_node*, bool) ../../gcc-13-20230219/gcc/gimplify.cc:17623 0xca958a gimplify_function_tree(tree_node*) ../../gcc-13-20230219/gcc/gimplify.cc:17822 0xad7fa7 cgraph_node::analyze() ../../gcc-13-20230219/gcc/cgraphunit.cc:676 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See for instructions.=