raeburn@athena.mit.edu (Ken Raeburn) (11/06/90)
Is there any documentation available describing the various passes of the C compiler? I'm curious about what some of the various passes do, and what some of the arguments mean (and how they relate to the original command line). For example, I compiled a couple of files together with -O3 on the DECstation on my desk: asdf.c: /usr/lib/cmplrs/cc2.1/cpp -v asdf.c -DLANGUAGE_C -DMIPSEL -I/usr/include2.1 > /tmp/ctmpa00156 /usr/lib/cmplrs/cc2.1/ccom -Xv -EL -Xg3 -O3 -XS/tmp/ctmsta00156 < /tmp/ctmpa00156 > /tmp/ctmfa00156 /usr/lib/cmplrs/cc2.1/ujoin -v -o asdf.u /tmp/ctmfa00156 /tmp/ctmsta00156 [same for asdf1.c -> asdf1.u] /usr/lib/cmplrs/cc2.1/uld /usr/lib/cmplrs/cc2.1/crt0.o asdf.u asdf1.u -lc -ko /tmp/ctmlua00156 /usr/lib/cmplrs/cc2.1/usplit -v -o /tmp/ctmsa00156 -t /tmp/ctmsta00156 /tmp/ctmlua00156 /usr/lib/cmplrs/cc2.1/umerge -v -noinline -g3 -O3 /tmp/ctmsa00156 -o /tmp/ctmma00156 -t /tmp/ctmsta00156 /usr/lib/cmplrs/cc2.1/uopt -v -G 8 -EL -g3 -O3 /tmp/ctmma00156 /tmp/ctmoa00156 -t /tmp/ctmsta00156 /tmp/ctmosa00156 uopt: foo(2)i main(2) /usr/lib/cmplrs/cc2.1/ugen -v -G 8 -EL -g3 -O3 /tmp/ctmoa00156 -o /tmp/ctmca00156 -t /tmp/ctmsta00156 -temp /tmp/ctmgta00156 ugen: foo main /usr/lib/cmplrs/cc2.1/as1 -v -G 8 -p0 -EL -g3 -O3 /tmp/ctmca00156 -o /tmp/ctmba00156 -t /tmp/ctmsta00156 as1: foo main /usr/lib/cmplrs/cc2.1/ld -G 8 -g3 -nocount /usr/lib/cmplrs/cc2.1/crt0.o -count /tmp/ctmba00156 -nocount -lc Most of the arguments seem obvious, but what exactly are the various temporary files, and are their formats documented? What are the "-noinline", "-count", and "-nocount" arguments for? What exactly do the various u* programs do? Is "-O3" really all that useful? What does it do, and how much of a difference does it make in the end?