This project is called GIMPLE FE (front-end). The first attempt never reached a useful state. It was restarted during GSoC'16, merged with gcc-8 and has been improving regularly since then. This is enabled with -fgimple .
The goal is to help write test cases. This is not a complete dump / reboot utility, as llvm provides. The dumps you get with -fdump-* (there is a -gimple modifier like in -fdump-tree-all-gimple to get the syntax that matches what FE reads) are good to let you know what happens but they do not contain enough information to restore internal structures. And the FE reads a dialect that allows you to specify only a small subset of the information that GIMPLE can encode.
Similarly, there is a partial RTL interface for this other gcc internal representation.
A more complete dump / reboot is provided by LTO. When you compile a file with -flto -c , gcc saves the GIMPLE representation as bytecode in the section of the .o file, which it can read again when called as the linker. This view is almost complete (I think there are some problems with debugging information). However, this does not mean that it is easy to read, like a text dump, and the exact format changes with each minor version of the compiler. In addition, you can reset / reload only at one predefined point in the pipeline, and not after an arbitrary pass.
Marc glisse
source share