I am studying Compilers course, compilation of program follows below steps
You can see the preprocessor output with -E. -fdump-tree-* dumps the tree internal represenation, e.g. -fdump-tree-all. Various -d options exist to dump the RTL intermediate representations, e.g. -fdump-rtl-all (see the manual for the invidual passes that you get dumps of); in addition, -dD dumps all macro definitions.