Useful Gcc Commandline Switches
Cynbe ru Taren
Gcc has hundreds of commandline switches; figuring out which ones
are useful when debugging gcc is no small task.
Here are a few key ones. For details on any of them see
GCC
Command Options.
- To generate pass-by-pass dumps: -fdump-tree-all -fdump-ipa-all -fdump-rtl-all
- Same? (Undocumented): -da
- To generate bigger pass-by-pass dumps: -fdump-tree-all-all -fdump-ipa-all-all -fdump-rtl-all-all
- To generate verbose assembly code: -fverbose-asm
- To generate RTL-annotated assembly code: -S -dP
- To save tmpfiles, in particular the critical foo.i preprocessed
file: --save-temps
- To suppress (for example) the ivopts pass: -fno-ivopts
- To show the critical cc1 commandline: -###
- To show linker actions: -Wl,--verbose
- To generate position-independent code: -fPIC
- Recommended by
gcc.gnu.org/wiki/DebuggingGCC: -dAp -Wa,-a
For more suggestions see
Options for Debugging Your Program or GCC.
[ Back to Cynbe's Gcc Debugging Hints ]
Cynbe ru Taren
Last modified: Tue Oct 9 18:51:06 CDT 2012