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.