From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1499E3858C5F; Thu, 8 Feb 2024 17:35:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1499E3858C5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707413734; bh=MHQPZrSp1IgQRHPksOmOZzokmM4l+dP+nCn88ArlJlI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=a1J9zJ5E2GuWnlqv1Ml0xt+JVQ21T+zbkzh0r2NlO/I0nXo6P5dwh0beBz8ObjeNO gsAiLleizaSWnKviw5LjZHpOGMrBB2d5CtZUmcGFP0ynlgTzJJ/IQmXuvZAkMAQjT6 D1FITCLZ96/Abq785D2MBpcyWLdhaviA3jfZLn1g= From: "gaius at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug modula2/113836] gm2 does not dump gimple or quadruples to a file Date: Thu, 08 Feb 2024 17:35:33 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: modula2 X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gaius at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: gaius at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created 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=3D113836 --- Comment #2 from Gaius Mulley --- Created attachment 57363 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D57363&action=3Dedit Proposed fix Here is a proposed fix which implements: -fdump-lang-all, -fdump-lang-quad, -fdump-lang-quad=3D, -fdump-lang-gimple, -fdump-lang-gimple=3D, -fm2-dump-f= ilter=3D. The filter must be a comma separated list which can take three forms: the f= ull decl textual name of a procedure, [libname.]module.ident or [filename.]module.ident. Currently it only filters on procedure names and regexp matching is not implemented. It would be straightforward to add regexp if required as a followup also there could be a another option to walk the tree and dump out= all dependants possibly. An example of it usage: $ gm2 hello3.mod -fdump-lang-all -fm2-whole-program -fm2-dump-filter=3D\ m2pim.Storage.ALLOCATE,\ m2pim.SysStorage.ALLOCATE,\ Storage_DEALLOCATE,NumberIO.HexToStr $ ls -1r a-hello3.mod.001l.quad a-hello3.mod.002l.quad a-hello3.mod.003l.quad a-hello3.mod.002l.gimple a-hello3.mod.001l.gimple a-hello3.mod.004l.quad Currently undergoing full bootstrapping testing.=