Invoking the compiler with -v
# vi: ft=sh
#
# The output of -v is printed to stderr.
#
# The following command redirects stderr to v.out
#
gcc -v main.c 2> v.out
#
# Some greps on v.out
#
grep 'gcc version' v.out
grep 'Thread model' v.out
grep 'Configured with' v.out
grep 'Target' v.out
grep 'COLLECT_LTO_WRAPPER' v.out
grep 'COLLECT_GCC' v.out
#
# With the .S suffix, cc1 is invoked first with
# the -E flag
#
gcc -v assembly.S 2> v.out
#
# With the .i suffix, cc1 is invoked with the -fpreprocessed flag
#
gcc -v already-preprocessed.i 2> v.out