From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8189D3857C61; Tue, 30 Mar 2021 09:58:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8189D3857C61 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/99826] New: GIMPLE FE fails to grok pointer declarators Date: Tue, 30 Mar 2021 09:58:15 +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: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org 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: Tue, 30 Mar 2021 09:58:15 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99826 Bug ID: 99826 Summary: GIMPLE FE fails to grok pointer declarators Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: rguenth at gcc dot gnu.org Target Milestone: --- char * __GIMPLE(ssa) foo(char *p) { char *_2; __BB(2): _2 =3D p_1(D); return _2; } shows two issues, first the return type declaration causes __GIMPLE to be not associated with the function, failing it to parse at all. Fixing that using a typedef shows that we fail to parse the SSA declaration 'char *_2' as SSA name declaration because we have /* Handle SSA name decls specially, they do not go into the identifier table but we simply build the SSA name for later lookup. */ unsigned version, ver_offset; if (declarator->kind =3D=3D cdk_id && is_gimple_reg_type (specs->type) but declarator is $5 =3D {kind =3D cdk_pointer, id_loc =3D 0, declarator =3D 0x3775200, u =3D= {id =3D { id =3D , attrs =3D }, arg_info =3D 0x0, array =3D= { dimen =3D , quals =3D 0, attrs =3D , static_p =3D= 0,=20 vla_unspec_p =3D 0}, pointer_quals =3D 0, attrs =3D }} in this case. It looks like we need to unwrap cdk_pointer at least (and build the actual pointer type in the SSA case). The "early-out" case for SSA names tries to avoid start_decl and building a decl (and registering it in the binding for future lookup).=