Re: Thompson's 2c vs. gcc (Preston Briggs)
Tue, 2 Feb 1993 19:11:38 GMT

          From comp.compilers

Related articles
Re: Architecture description languages for compilers? (1993-01-28)
Thompson's 2c vs. gcc (Michael John Haertel) (1993-01-29)
Re: Thompson's 2c vs. gcc (1993-02-02)
Re: Thompson's 2c vs. gcc (Michael John Haertel) (1993-02-04)
Re: Thompson's 2c vs. gcc (1993-02-04)
Re: Thompson's 2c vs. gcc (1993-02-05)
Re: Thompson's 2c vs. gcc (1993-02-05)
| List of all articles for this month |

Newsgroups: comp.compilers
From: (Preston Briggs)
Keywords: architecture, GCC
Organization: Rice University, Houston
References: 93-01-205 93-02-003
Date: Tue, 2 Feb 1993 19:11:38 GMT

Pardo wrote:
>It is an amusing exercise to compare the listed md sizes for the Thompson
>compiler to the GCC md sizes for the same machines. I can't say whether
>the code is comparable: Thompson claims the compile time is half that of
>GCC and run time is 75% that of GCC, but it shows only slightly better run
>times than lcc, and a previous comp.compilers article said lcc was
>substantially worse than GCC.

Michael John Haertel <> writes:
>I've used 2c. My experience is that gcc produces better code, contrary to
>Thompson's claim. He most likely forgot to turn on -O with gcc. Without
>-O, gcc produces really pessimal code, considerably slower than pcc
>without -O for example.

Is 2c the same compiler that Thompson writes about in his paper "A New C
Compiler"? Very well.

Remember that Thompson wrote his paper about 3 years ago (published in
July 1990). Gcc has evolved substantially since then. Your experinces
today don't mean Thompson lied yesterday (or "forgot" the -O flag).

Thompson says:

"Although it was not possible to directly compare gcc to the
new compiler, lcc typically compiles in 50% of the time of gcc
and the object runs in 75% of the time of gcc."

The times for lcc and the new C compiler are given as

1.0s new cc compile time
0.5s new cc load time
90.4s new cc run time

1.6s lcc compile time
0.1s lcc load time
96.3s lcc run time

Further, the tests were conducted with different operating systems. So
Thompson only offers direct comparisons with lcc. His comments about gcc
are probably a reflection of the experience described in Fraser and
Hanson's paper "A Retargetable Compiler for ANSI C". They compare with
gcc version 1.35 (i.e., old!) with and without -O using four programs from
the SPECmark suite (gcc1.35, expresso, li, and eqntott) and running on 4
different machines. I won't reproduce the entire table, but I'll try to
summarize honestly.

For object code speed, plain gcc usually produces slightly faster code on
the VAX and 68020; lcc produces faster code for the MIPS and Sparc
(Thompson's figure of 75% less run time is reasonable). gcc -O dominates
lcc on the VAX, 68020, and Sparc, but lcc is wins more than it loses on
the MIPS.

For compile time, they don't compare with gcc -O. However, lcc is
typically between 2 and 3 times as fast as plain gcc on all reported

Thompson's comparisons with lcc were conducted on the MIPS. It seems
reasonable that his remarks about gcc reflect the (at the time) poor
implementation of gcc on the MIPS.

Preston Briggs

Post a followup to this message

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