On Mon, 2026-10-19 at 10:50 -0700, Andrea Pinski via Gcc wrote:
> On Mon, Oct 19, 2026 at 9:59 AM jf84ut--- via Gcc <[email protected]>
> wrote:
> > 
> > Dear friends at gcc.gnu.org,
> > 
> > Thank you for gcc, which is one of the most wonderful pieces of
> > software that humankind has produced.
> > 
> > I'd like to modify gcc to target a CPU that I'm designing.  The RTL
> > used by the intermediate stages of gcc, unfortunately, won't be
> > useful
> > for me.  I'd like to find a way to dump the tree-like data
> > structure,
> > that consists of the compiled program, with symbol resolution,
> > ]constant folding, etc., having been done, just before it's
> > transformed
> > into the linear RTL.  The output might be in a simple lisp-like
> > format.  It seems that I'll need to modify gcc in order to do this.
> > I've looked at e.g. the gcc "-fdump-tree-optimized" switch.  This
> > doesn't give me what I need.
> 
> What exact information do you need?  -fdump-rtl-expand-details-alias
> will provide how each gimple statement is expanded into RTL and some
> other useful information.
> The alias modifier enables the dumping of the aliasing information on
> the pointer ssa names and also the dumping of the range information
> on
> all others.

Hi Lyman

I assume you've looked at
  -fdump-tree-all -fdump-gimple-all -fdump-rtl-all

FWIW you might also want to look at:
  -fdiagnostics-add-output=sarif:cfgs=yes

I added the "cfgs=yes" in GCC 16; it adds the internal state of the CFG
for all functions after each optimization pass[1] in JSON form to the
SARIF output (below theRun.graphs).  The SARIF output is thus a
machine-readable serialization of (some of) GCC's intermediate
representation (as JSON), but it's much less than, say, the old "GCC-
XML" experiment used to provide.  The precise form of the information
is subject to change without notice.

Dave
[1] for passes for which the IR *has* CFGs, which isn't the case for
very early gimple and very late RTL ones

> 
> Thanks,
> Andrea
> 
> 
> > 
> > Would anyone who has suggestions, about where I should look in the
> > source code for gcc, to see these data structures that I'd like to
> > dump, please email me?
> > 
> > Many thanks,
> > 
> > Lyman Opie
> > [email protected]
> > 

Reply via email to