Two-pass C compilers

maniattb@cs.rpi.edu (Bill Maniatty)
Sat, 15 Aug 1992 20:45:24 GMT

          From comp.compilers

Related articles
Two-pass C compilers maniattb@cs.rpi.edu (1992-08-15)
Re: Two-pass C compilers behrenss@Informatik.TU-Muenchen.DE (1992-08-16)
Re: Two-pass C compilers quanstro@stolaf.edu (1992-08-16)
Re: Two-pass C compilers markh@csd4.csd.uwm.edu (1992-08-16)
Re: Two-pass C compilers sasghm@unx.sas.com (Gary Merrill) (1992-08-17)
Re: Two-pass C compilers leichter@zodiac.rutgers.edu (1992-08-18)
Re: Two-pass C compilers mcrware!adam@uunet.UU.NET (1992-08-19)
| List of all articles for this month |
Newsgroups: comp.compilers,comp.lang.c
From: maniattb@cs.rpi.edu (Bill Maniatty)
Organization: Compilers Central
Date: Sat, 15 Aug 1992 20:45:24 GMT
Keywords: C
Re: Why is compiled basic slower than C? (Basic is the future)

|> C requires more than one pass for compilation, and
|> therefore compiles slower than Basic.


Some of the wise guys (I mean friends) in my office challenged my
assertion that C requires more than one pass to compile. I'm of the
impression that C compilers use more than one pass. Since they challenged
me, I get to make up the rules of this contest which are:
1). Ansi 'C' is the grammar.
2). If we skip optimization, is there any construct in C that would
require multiple passes, and if not how do we avoid many passes?
3). How about if we perform optimization (specify the optimizations
please), can it be done in 1 pass?
4). Are there any one pass C compilers out there. (That is C done with
2+ pass compilers for purely historical reasons?)


If I was wrong, I apologize for misleading anyone, but if I'm correct then
in their face! :-)


Bill
--
maniattb@cs.rpi.edu - in real life Bill Maniatty
[Depends on what you mean by pass. Most C compilers I know turn C into
assembler and only read the source once. Whether you think of the
assembler as a second pass is a matter of semantics. Some compilers, e.g.
Turbo C, go directly from C to object code, again only reading the source
once. In this regard I can't see any way that C differs from Basic or
Fortran, both of which are about equally easy or hard to process in one
pass. PL/I is a little harder to do in one pass since you're allowed to
declare variables after you use them. -John]
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.