public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug modula2/113836] New: gm2 does not dump gimple or quadruples to a file
@ 2024-02-08 17:17 gaius at gcc dot gnu.org
2024-02-08 17:19 ` [Bug modula2/113836] " gaius at gcc dot gnu.org
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: gaius at gcc dot gnu.org @ 2024-02-08 17:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113836
Bug ID: 113836
Summary: gm2 does not dump gimple or quadruples to a file
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: modula2
Assignee: gaius at gcc dot gnu.org
Reporter: gaius at gcc dot gnu.org
Target Milestone: ---
During the early exploratory stage in PR113588 it would have been useful to be
able to dump the modula-2 quadruples and gimple representation to file (rather
than stdout).
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug modula2/113836] gm2 does not dump gimple or quadruples to a file
2024-02-08 17:17 [Bug modula2/113836] New: gm2 does not dump gimple or quadruples to a file gaius at gcc dot gnu.org
@ 2024-02-08 17:19 ` gaius at gcc dot gnu.org
2024-02-08 17:35 ` gaius at gcc dot gnu.org
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: gaius at gcc dot gnu.org @ 2024-02-08 17:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113836
Gaius Mulley <gaius at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2024-02-08
--- Comment #1 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Following on from a discussion on irc it was suggested that filtering the IR
would be useful.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug modula2/113836] gm2 does not dump gimple or quadruples to a file
2024-02-08 17:17 [Bug modula2/113836] New: gm2 does not dump gimple or quadruples to a file gaius at gcc dot gnu.org
2024-02-08 17:19 ` [Bug modula2/113836] " gaius at gcc dot gnu.org
@ 2024-02-08 17:35 ` gaius at gcc dot gnu.org
2024-02-08 20:23 ` gaius at gcc dot gnu.org
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: gaius at gcc dot gnu.org @ 2024-02-08 17:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113836
--- Comment #2 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Created attachment 57363
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57363&action=edit
Proposed fix
Here is a proposed fix which implements: -fdump-lang-all, -fdump-lang-quad,
-fdump-lang-quad=, -fdump-lang-gimple, -fdump-lang-gimple=, -fm2-dump-filter=.
The filter must be a comma separated list which can take three forms: the full
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=\
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.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug modula2/113836] gm2 does not dump gimple or quadruples to a file
2024-02-08 17:17 [Bug modula2/113836] New: gm2 does not dump gimple or quadruples to a file gaius at gcc dot gnu.org
2024-02-08 17:19 ` [Bug modula2/113836] " gaius at gcc dot gnu.org
2024-02-08 17:35 ` gaius at gcc dot gnu.org
@ 2024-02-08 20:23 ` gaius at gcc dot gnu.org
2024-02-08 21:32 ` gaius at gcc dot gnu.org
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: gaius at gcc dot gnu.org @ 2024-02-08 20:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113836
Gaius Mulley <gaius at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #57363|0 |1
is obsolete| |
--- Comment #3 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Created attachment 57367
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57367&action=edit
Proposed fix v3
Add a missing file and I've now seen it bootstrap successfully on ppc64le.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug modula2/113836] gm2 does not dump gimple or quadruples to a file
2024-02-08 17:17 [Bug modula2/113836] New: gm2 does not dump gimple or quadruples to a file gaius at gcc dot gnu.org
` (2 preceding siblings ...)
2024-02-08 20:23 ` gaius at gcc dot gnu.org
@ 2024-02-08 21:32 ` gaius at gcc dot gnu.org
2024-02-11 17:29 ` gaius at gcc dot gnu.org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: gaius at gcc dot gnu.org @ 2024-02-08 21:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113836
--- Comment #4 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Bootstrap completed and no extra failures seen in C, C++, Fortan or Modula-2.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug modula2/113836] gm2 does not dump gimple or quadruples to a file
2024-02-08 17:17 [Bug modula2/113836] New: gm2 does not dump gimple or quadruples to a file gaius at gcc dot gnu.org
` (3 preceding siblings ...)
2024-02-08 21:32 ` gaius at gcc dot gnu.org
@ 2024-02-11 17:29 ` gaius at gcc dot gnu.org
2024-02-12 12:34 ` gaius at gcc dot gnu.org
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: gaius at gcc dot gnu.org @ 2024-02-11 17:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113836
Gaius Mulley <gaius at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #57367|0 |1
is obsolete| |
--- Comment #5 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Created attachment 57388
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57388&action=edit
Proposed fix v8
This fixes an option bug and allows init/fini module ctor procedures to be
dumped.
Currently testing --enable-languages=all and comparing results before posting
to patches.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug modula2/113836] gm2 does not dump gimple or quadruples to a file
2024-02-08 17:17 [Bug modula2/113836] New: gm2 does not dump gimple or quadruples to a file gaius at gcc dot gnu.org
` (4 preceding siblings ...)
2024-02-11 17:29 ` gaius at gcc dot gnu.org
@ 2024-02-12 12:34 ` gaius at gcc dot gnu.org
2024-02-12 13:47 ` gaius at gcc dot gnu.org
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: gaius at gcc dot gnu.org @ 2024-02-12 12:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113836
Gaius Mulley <gaius at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #57388|0 |1
is obsolete| |
--- Comment #6 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Created attachment 57395
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57395&action=edit
Proposed fix v10 (corrects documentation)
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug modula2/113836] gm2 does not dump gimple or quadruples to a file
2024-02-08 17:17 [Bug modula2/113836] New: gm2 does not dump gimple or quadruples to a file gaius at gcc dot gnu.org
` (5 preceding siblings ...)
2024-02-12 12:34 ` gaius at gcc dot gnu.org
@ 2024-02-12 13:47 ` gaius at gcc dot gnu.org
2024-03-21 19:39 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: gaius at gcc dot gnu.org @ 2024-02-12 13:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113836
--- Comment #7 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Patch posted.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug modula2/113836] gm2 does not dump gimple or quadruples to a file
2024-02-08 17:17 [Bug modula2/113836] New: gm2 does not dump gimple or quadruples to a file gaius at gcc dot gnu.org
` (6 preceding siblings ...)
2024-02-12 13:47 ` gaius at gcc dot gnu.org
@ 2024-03-21 19:39 ` cvs-commit at gcc dot gnu.org
2024-05-02 10:38 ` gaius at gcc dot gnu.org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-03-21 19:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113836
--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Gaius Mulley <gaius@gcc.gnu.org>:
https://gcc.gnu.org/g:48d49200510198cafcab55601cd8e5f8eb541f01
commit r14-9599-g48d49200510198cafcab55601cd8e5f8eb541f01
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date: Thu Mar 21 19:38:03 2024 +0000
PR modula2/113836 gm2 does not dump gimple or quadruples to file
This patch provides the localized modula2 changes to gcc/m2
which facilitate the dumping of gimple and quadruples to file.
PR modula2/113836 will be full complete after a subsequent patch
adding changes to lang.opt and documentation. The lang.opt
patch requires all language bootstrap regression testing whereas
this patch is isolated to gcc/m2 and only the m2 language.
gcc/m2/ChangeLog:
PR modula2/113836
* Make-lang.in (GM2_C_OBJS): Add m2/gm2-gcc/m2pp.o.
(m2/m2pp.o): Remove rule.
(GM2-COMP-BOOT-DEFS): Add M2LangDump.def.
(GM2-COMP-BOOT-MODS): Add M2LangDump.mod.
(GM2-GCC-DEFS): Add M2LangDump.def.
(GM2-GCC-MODS): Add M2LangDump.mod.
* gm2-compiler/M2CaseList.mod (WriteCase): Rewrite.
* gm2-compiler/M2Code.mod (DoModuleDeclare): Call
DumpFilteredResolver depending upon DumpLangDecl.
(DoCodeBlock): Call CreateDumpGimple depending upon
DumpLangGimple.
(Code): Replace DisplayQuadList blocks with DumpQuadruples.
(DisplayQuadsInScope): Remove.
(DisplayQuadNumbers): Remove.
(CodeBlock): Rewrite.
* gm2-compiler/M2GCCDeclare.def (IncludeDumpSymbol): New procedure.
(DumpFilteredResolver): New procedure.
(DumpFilteredDefinitive): New procedure.
* gm2-compiler/M2GCCDeclare.mod (IncludeDumpSymbol): New procedure.
(DumpFilteredResolver): New procedure.
(DumpFilteredDefinitive): New procedure.
(doInclude): Rewrite to use GetDumpFile.
(WatchIncludeList): Remove fixed debugging value.
(doExclude): Rewrite to use GetDumpFile.
(DeclareTypesConstantsProceduresInRange): Remove fixed debugging
values.
(PreAddModGcc): Rename parameter t as tree.
(IncludeGetNth): Rewrite to use GetDumpFile.
(IncludeType): Ditto.
(IncludeSubscript): Ditto.
(PrintLocalSymbol): Ditto.
(PrintLocalSymbols): Ditto.
(IncludeGetVarient): Ditto.
(PrintDeclared): Ditto.
(PrintAlignment): Ditto.
(PrintDecl): Ditto.
(PrintScope): Ditto.
(PrintProcedure): Ditto.
(PrintSym): Ditto.
(PrintSymbol): Ditto.
(PrintTerse): Ditto.
* gm2-compiler/M2Options.def (GetDumpLangDeclFilename): New
procedure function.
(SetDumpLangDeclFilename): New procedure.
(GetDumpLangQuadFilename): New procedure function.
(SetDumpLangQuadFilename): New procedure.
(GetDumpLangGimpleFilename): New procedure function.
(SetDumpLangGimpleFilename): New procedure.
(SetM2DumpFilter): New procedure.
(GetM2DumpFilter): New procedure function.
(GetDumpLangGimple): New procedure function.
* gm2-compiler/M2Options.mod (GetDumpLangDeclFilename): New
procedure function.
(SetDumpLangDeclFilename): New procedure.
(GetDumpLangQuadFilename): New procedure function.
(SetDumpLangQuadFilename): New procedure.
(GetDumpLangGimpleFilename): New procedure function.
(SetDumpLangGimpleFilename): New procedure.
(SetM2DumpFilter): New procedure.
(GetM2DumpFilter): New procedure function.
(GetDumpLangGimple): New procedure function.
* gm2-compiler/M2Quads.def (DumpQuadruples): New procedure.
* gm2-compiler/M2Quads.mod (DumpUntil): New procedure.
(GetCtorInit): New procedure function.
(GetCtorFini): New procedure function.
(DumpQuadrupleFilter): New procedure function.
(DumpQuadrupleAll): New procedure.
(DisplayQuadList): Remove procedure.
(DumpQuadruples): New procedure.
(DisplayQuadRange): Rewrite.
(DisplayQuad): Ditto.
(DisplayProcedureAttributes): Ditto.
(WriteOperator): Ditto.
(WriteMode): Ditto.
* gm2-compiler/M2Scope.mod (ForeachScopeBlockDo2): Replace
DisplayQuadruples with TraceQuadruples.
(ForeachScopeBlockDo3): Replace DisplayQuadruples with
TraceQuadruples.
* gm2-compiler/SymbolConversion.def (Gcc2Mod): New procedure
function.
* gm2-compiler/SymbolConversion.mod: New procedure function.
* gm2-gcc/m2misc.cc (m2misc_DebugTree): New function.
(m2misc_DebugTreeChain): New function.
* gm2-gcc/m2options.h (M2Options_GetDumpLangDeclFilename): New
prototype.
(M2Options_SetDumpLangDeclFilename): New prototype.
(M2Options_GetDumpLangQuadFilename): New prototype.
(M2Options_SetDumpLangQuadFilename): New prototype.
(M2Options_GetDumpLangGimpleFilename): New prototype.
(M2Options_SetDumpLangGimpleFilename): New prototype.
(M2Options_GetDumpLangGimple): New prototype.
(M2Options_SetM2DumpFilter): New prototype.
(M2Options_GetM2DumpFilter): New prototype.
* m2pp.cc: Move to...
* gm2-gcc/m2pp.cc: ...here.
* m2pp.h: Move to...
* gm2-gcc/m2pp.h: ...here.
* gm2-gcc/m2statement.cc (m2statement_BuildEndFunctionCode): Call
m2pp_dump_gimple.
* gm2-lang.cc (ENABLE_QUAD_DUMP_ALL): New define.
(gm2_langhook_init_options): Add switch cases for proposed new
command line options.
* gm2-libs/DynamicStrings.def (ReverseIndex): New procedure
function.
* gm2-libs/DynamicStrings.mod: New procedure function.
* gm2-compiler/M2LangDump.def: New file.
* gm2-compiler/M2LangDump.mod: New file.
* gm2-gcc/m2langdump.h: New file.
* gm2-gcc/m2pp.def: New file.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug modula2/113836] gm2 does not dump gimple or quadruples to a file
2024-02-08 17:17 [Bug modula2/113836] New: gm2 does not dump gimple or quadruples to a file gaius at gcc dot gnu.org
` (7 preceding siblings ...)
2024-03-21 19:39 ` cvs-commit at gcc dot gnu.org
@ 2024-05-02 10:38 ` gaius at gcc dot gnu.org
2024-05-02 12:16 ` cvs-commit at gcc dot gnu.org
2024-05-02 12:18 ` gaius at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: gaius at gcc dot gnu.org @ 2024-05-02 10:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113836
Gaius Mulley <gaius at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #57395|0 |1
is obsolete| |
--- Comment #9 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Created attachment 58086
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58086&action=edit
Proposed fix
Here is the proposed patch implementing all the dump options (and symbol
filtering).
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug modula2/113836] gm2 does not dump gimple or quadruples to a file
2024-02-08 17:17 [Bug modula2/113836] New: gm2 does not dump gimple or quadruples to a file gaius at gcc dot gnu.org
` (8 preceding siblings ...)
2024-05-02 10:38 ` gaius at gcc dot gnu.org
@ 2024-05-02 12:16 ` cvs-commit at gcc dot gnu.org
2024-05-02 12:18 ` gaius at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-05-02 12:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113836
--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Gaius Mulley <gaius@gcc.gnu.org>:
https://gcc.gnu.org/g:43dc4302b4181535d24e83759514b774ae4dbfcc
commit r15-110-g43dc4302b4181535d24e83759514b774ae4dbfcc
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date: Thu May 2 13:16:07 2024 +0100
PR modula2/113836 gm2 does not dump gimple or quadruples to a file
This patch completes the implementation of dumping the intermediate forms
to file. It implements the filtering on symbol rules. Filtering can be
performed through the full text name (given to the GCC tree) or qualified
modula-2 symbol or filename:qualident.
gcc/ChangeLog:
PR modula2/113836
* doc/gm2.texi (Compiler options): Add -fm2-debug-trace=,
-fm2-dump, -fm2-dump-decl=, -fm2-dump-gimple=, -fm2-dump-quad=
and -fm2-dump-filter=.
gcc/m2/ChangeLog:
PR modula2/113836
* gm2-compiler/M2AsmUtil.def: Remove export qualified and
unused import.
* gm2-compiler/M2LangDump.mod (AddRuleTextDump): New procedure.
(AddRuleScopeQualidentDump): Add warning check against unmatched
rule.
(GenQualidentSymString): New procedure function.
(IdentQualidentMatch): New procedure function.
(IsRuleFilenameMatch): New procedure function.
(CheckRuleMatch): New procedure function.
(AddRuleFilenameDump): New procedure function.
* gm2-gcc/m2misc.cc (m2misc_warning_m2_dump_filter): New function.
* gm2-gcc/m2misc.def (warning_m2_dump_filter): New procedure.
* gm2-gcc/m2misc.h (m2misc_warning_m2_dump_filter): New prototype.
* gm2-gcc/m2pp.cc (VERBOSE_TYPE_DESC): New define.
(m2pp_identifier): Define out verbose type info.
(m2pp_constructor): Define out verbose type info.
(m2pp_assignment): Define out verbose type info.
* gm2-lang.cc (ENABLE_M2DUMP_ALL): Remove.
* lang.opt (fm2-dump): Add.
(fm2-dump-decl=): Add.
(fm2-dump-gimple=): Add.
(fm2-dump-quad=): Add.
(fm2-dump-filter=): Add.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug modula2/113836] gm2 does not dump gimple or quadruples to a file
2024-02-08 17:17 [Bug modula2/113836] New: gm2 does not dump gimple or quadruples to a file gaius at gcc dot gnu.org
` (9 preceding siblings ...)
2024-05-02 12:16 ` cvs-commit at gcc dot gnu.org
@ 2024-05-02 12:18 ` gaius at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: gaius at gcc dot gnu.org @ 2024-05-02 12:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113836
Gaius Mulley <gaius at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #11 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Closing now the patch has been applied.
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2024-05-02 12:18 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-08 17:17 [Bug modula2/113836] New: gm2 does not dump gimple or quadruples to a file gaius at gcc dot gnu.org
2024-02-08 17:19 ` [Bug modula2/113836] " gaius at gcc dot gnu.org
2024-02-08 17:35 ` gaius at gcc dot gnu.org
2024-02-08 20:23 ` gaius at gcc dot gnu.org
2024-02-08 21:32 ` gaius at gcc dot gnu.org
2024-02-11 17:29 ` gaius at gcc dot gnu.org
2024-02-12 12:34 ` gaius at gcc dot gnu.org
2024-02-12 13:47 ` gaius at gcc dot gnu.org
2024-03-21 19:39 ` cvs-commit at gcc dot gnu.org
2024-05-02 10:38 ` gaius at gcc dot gnu.org
2024-05-02 12:16 ` cvs-commit at gcc dot gnu.org
2024-05-02 12:18 ` gaius at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).