Hello

Lyman Opie asked:

> 
> 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.


I suggest looking into https://arxiv.org/abs/1109.0779 (but I am no
longer working on GCC)

Practically, I would recommend first writing a GCC plugin
https://gcc.gnu.org/onlinedocs/gccint/Plugins.html
ptobably after PLUGIN_ALL_IPA_PASSES_START
(in pratice GCC plugins should be open source and the details vary from
one release to the next).

Your plugin would work on the SSA representation.
https://gcc.gnu.org/onlinedocs/gccint/SSA.html

Maybe you want to either store some internal representation of the
compiled code in some database (or textual JSON or HJSON).

Look also into the compcert.org project.

good luck.

NB: sorry for my bad English, I am French and working on refpersys.org
-- 

Basile STARYNKEVITCH                           
<[email protected]>
8 rue de la Faïencerie                      
http://starynkevitch.net/Basile/  
92340 Bourg-la-Reine                        
https://github.com/bstarynk
France                               
https://github.com/RefPerSys/RefPerSys
                  https://orcid.org/0000-0003-0908-5250

Reply via email to