From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 11E203858D39; Tue, 5 Oct 2021 09:48:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 11E203858D39 From: "aldyh at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug other/102605] New: address instruction from -fdump-tree-*-gimple doesn't work with -fgimple Date: Tue, 05 Oct 2021 09:48:08 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: other X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: aldyh 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 blocked 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, 05 Oct 2021 09:48:09 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102605 Bug ID: 102605 Summary: address instruction from -fdump-tree-*-gimple doesn't work with -fgimple Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: other Assignee: unassigned at gcc dot gnu.org Reporter: aldyh at gcc dot gnu.org Blocks: 101057 Target Milestone: --- The following snippet: $ cat y.c void bar(); char global[10]; void foo(char *p) { if (&global[2] =3D=3D p) bar(); } ...when converted to GIMPLE: $ ./cc1 y.c -fdump-tree-ssa-gimple -quiet $ cat y.c.022t.ssa=20 void __GIMPLE (ssa) foo (char * p) { __BB(2): if (p_2(D) =3D=3D &global[2]) goto __BB3; else goto __BB4; __BB(3): bar (); goto __BB4; __BB(4): return; } Does not compile with -fgimple: $ mv y.c.022t.ssa z.c $ ./cc1 z.c -fgimple -quiet z.c: In function =E2=80=98foo=E2=80=99: z.c:5:17: error: expected expression before =E2=80=98&=E2=80=99 token 5 | if (p_2(D) =3D=3D &global[2]) | ^ z.c: At top level: z.c:5:27: error: expected identifier or =E2=80=98(=E2=80=99 before =E2=80= =98)=E2=80=99 token 5 | if (p_2(D) =3D=3D &global[2]) | ^ z.c:7:3: error: expected identifier or =E2=80=98(=E2=80=99 before =E2=80=98= else=E2=80=99 7 | else | ^~~~ z.c:10:8: error: expected declaration specifiers or =E2=80=98...=E2=80=99 b= efore numeric constant 10 | __BB(3): | ^ z.c:12:3: error: expected identifier or =E2=80=98(=E2=80=99 before =E2=80= =98goto=E2=80=99 12 | goto __BB4; | ^~~~ z.c:14:8: error: expected declaration specifiers or =E2=80=98...=E2=80=99 b= efore numeric constant 14 | __BB(4): | ^ z.c:17:1: error: expected identifier or =E2=80=98(=E2=80=99 before =E2=80= =98}=E2=80=99 token 17 | } | ^ Is the output from -fdump-tree-*-gimple suppose to be compilable by -fgimpl= e?=20 If not, what is the appropriate way of representing &global[2] in the gimple FE? Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101057 [Bug 101057] [gimplefe] GIMPLE frontend issues=