From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8F5EB3852C53; Thu, 17 Nov 2022 20:06:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8F5EB3852C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668715566; bh=xNEvN8Lv5J8TjjG7Kymy3n0Jpwh0rD1aJop43jzmpvQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RMgqY2AmsO64TrmFysIEvJl/rdZDrCSBPE/4f8pDGpMeeIV4VtkmZJbmqkVNkuSpp C9S7t5pxXIZvVMQoHAd93TpdeouwXaTvBDKj/v3+9WSWZAJwtji6Ud/NqRcDu/rpcz 9wGls9tVrLJSI6VpDpc3Wcm/FXVClGcb6r958JjU= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/106764] [12/13 Regression] ICE on invalid code in tree check: expected function_type or method_type, have error_mark in gimplify_call_expr, at gimplify.cc Date: Thu, 17 Nov 2022 20:06:05 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: error-recovery, ice-checking, ice-on-invalid-code X-Bugzilla-Severity: trivial X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pinskia at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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=3D106764 --- Comment #3 from Andrew Pinski --- At the point where the CALL_EXPR is built: Breakpoint 5, build_function_call_vec (loc=3D258624, arg_loc=3D..., function=3D, params=3D0x0, origtypes=3D0x0, orig_fundecl=3D) at /home/apinski/src/upstream-gcc/gcc/gcc/c/c-typeck.cc:3250 3250 fntype =3D TREE_TYPE (function); function is: (gdb) p debug_tree(function) QI size unit-size align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type 0x7ffff726e9d8 pointer_to_this > unsigned DI size unit-size align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type 0x7ffff73e5930> used public static unsigned read DI defer-output t.c:1:3 size unit-size align:64 warn_if_not_align:0> And the type is fine. And then the code in duplicate_decls goes and replaces the type to be error_mark_node. And then we don't check for error_mark_node later on during gimplification. Trying to figure out the best place to put the check for error_mark_node no= w. Note while looking into the gimplification code, I found some odd looking c= ode dealing with the location so I filed PR 107737.=