I have generated dump output files using command -fdump-tree-all
and -fdump-rtl-all
and I got a lot of dump files. I have read that the codes in GIMPLE are in pseudo-C syntax and RTL dump files are too low level to be understood. Is there any ways to understand GIMPLE and RTL dump files? Any software that can convert it to C code or something useful? Any tutorial to learn to understand it? Thanks
Asked
Active
Viewed 1,837 times
3

linuxqwerty
- 198
- 16
1 Answers
4
the best way to do it (for me) is to dump some examples and understand by yourself the emitted code. It's not difficult, there are some change from the original code (like cycles are transformed in if with goto), there are a lot of passes in gcc and my advice is to dump what you need. In my case i use frequently the commands:
-fdump-tree-lower
-fdump-tree-cfg
-fdump-tree-ssa
-fdump-tree-optimized (it's the last pass before going into rtl passes)
rtl is almost incompressible and it's needed a great understanding over that dialect

Jordy Baylac
- 510
- 6
- 18
-
thanks. what are the key differences to look for and what significance can one obtain from there? Is it the data flow? Can I get the data being parsed by the gcc from each pass? – linuxqwerty Aug 06 '15 at 02:53
-
sorry by the time, almost all dumps are emitted (by gcc) in a Control Flow Graph description, cause of it´s more understood and more easy, the dataflow and the cfg, and even the callgraph, are being used and supplied in each pass with information, and of course, transformation take place. However, the dataflow is better seen in ssa pass, as i mentioned above – Jordy Baylac Aug 12 '15 at 01:22
-
i recommend you to do a man gcc with a grep pipe and the search text can be "-fdump", because of there are anothers set of passes like IPA, IPO ... – Jordy Baylac Aug 12 '15 at 01:42
-
2I also can recommend using this document https://gcc.gnu.org/onlinedocs/gcc-9.1.0/gcc.pdf and this https://gcc.gnu.org/onlinedocs/gccint.pdf and use -da -dp for all output -fdump-tree-all-raw-lineno for string number, and view all steps of transformation/optimization. Here is simple explanation https://www.cse.iitb.ac.in/~uday/courses/cs715-09/gcc-rtl.pdf – Alexy Khilaev Jul 05 '19 at 03:55