Date: Fri, 20 Jun 2003 16:18:45 -0400 Message-Id: <200306202018.h5KKIjZD027328@envy.delorie.com> From: DJ Delorie To: djgpp AT delorie DOT com In-reply-to: <3ef366a3_5@corp.newsgroups.com> (some.net@delorie.com) Subject: Re: DJGPP internals References: <3ef366a3_5 AT corp DOT newsgroups DOT com> Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Does anyone know (I know DJ does) Yes, I know ;-) > how many passes the djgpp compiler does? If I'm correct modern > compiler are 3 pass compilers. c0-c2 or is that c3? The notion of "passes" is fuzzy in gcc. There are 4-5 programs involved (newer ones have cpp and cc1 combined): * gcc (driver) * cpp * cc1 * as * ld Within cc1, there are a few major activities going on: * Conversion of source language to a parse tree * Optimization of the parse tree. * Conversion of the parse tree to RTL. * Optimization of the RTL. * Conversion of RTL to assembly. If you want to know how many times any of these programs loops over the program (in whatever form it's in), the answer is LOTS. Even the assembler is a multi-pass assembler. > How does the crt.o or C runtime fit into the compiling of the source? It's only used at the very end, when the linker is invoked.