[gnu.gcc.help] Why RTL for GCC ?

dlpress@hubcap.clemson.edu (david pressley) (11/13/90)

     I have a few questions about the GNU C (GCC) compiler. If you could
be of some assistance, please respond. 

     1) Why was the GNU C compiler implemented using RTL (Register 
        Transfer Language) as opposed to 4-tuples or quads?

     2) Is there an interpreter or simulator available for RTL? 

     3) To your knowledge, has anyone done a study comparing quads and 
        RTL?  

     4) What would have to be added to quads to accomplish what is done with
        RTL?

I appreciate any response you can give me.   

                                             Thank You
                                             David Pressley
                                                                
                                             pressley@hubcap.clemson.edu
[The simple answer to 1) is that GCC is based on an earlier compiler that
used RTL, but I don't know the original motivation.  Perhaps it appeared
easier to retarget. -John]
-- 
Send compilers articles to compilers@iecc.cambridge.ma.us or
{ima | spdcc | world}!esegue!compilers.  Meta-mail to compilers-request.

mike@vlsivie.tuwien.ac.at (Michael K. Gschwind) (11/15/90)

In article <11535@hubcap.clemson.edu> dlpress@hubcap.clemson.edu (david pressley) writes:
>     1) Why was the GNU C compiler implemented using RTL (Register 
>        Transfer Language) as opposed to 4-tuples or quads?

I think the technical reason is the `combine' pass, which can generate 
arbitrarily complex RTLs. If you allow 4-tuples with 4-tuples as args,
it would probably be quite similar to RTL. I guess they would actually 
be the same, apart from syntax ;-)

>     2) Is there an interpreter or simulator available for RTL? 
Somebody is working on it. The idea is also mentioned in 
IDEAS (or TO-DO) in the g++ distribution.

>     4) What would have to be added to quads to accomplish what is done with
>        RTL?

Nesting of quads (?)

>[The simple answer to 1) is that GCC is based on an earlier compiler that
>used RTL, but I don't know the original motivation.  Perhaps it appeared
>easier to retarget. -John]

I think GCC was NOT derived from a compiler, but from a machine code 
optimizer written at the U. of Arizona. It's more natural to map 
machine instructions to RTL than quads.

			bye,
				mike

Michael K. Gschwind, Institute for VLSI-Design, Vienna University of Technology
mike@vlsivie.tuwien.ac.at
mike@vlsivie.uucp
e182202@awituw01.bitnet
Voice: (++43).1.58801 8144
Fax:   (++43).1.569697
[I have heard that GCC also derives from a Pascal compiler done at Livermore,
but perhaps someone who knows could tell us where it really came from. -John]
-- 
Send compilers articles to compilers@iecc.cambridge.ma.us or
{ima | spdcc | world}!esegue!compilers.  Meta-mail to compilers-request.

dg@iesd.auc.dk (Dieter Gehrke) (11/18/90)

In article <9011151401.AA16023@tuvie.tuwien.ac.at> mike@vlsivie.tuwien.ac.at (Michael K. Gschwind) writes:

> I think GCC was NOT derived from a compiler, but from a machine code
> optimizer written at the U. of Arizona. It's more natural to map machine
> instructions to RTL than quads.

Maybe so, but have you tried to map Transputer machine code to RTL?
The transputer is a stack machine, RTL is intended for register
machines.

-Dieter Gehrke (dg@iesd.auc.dk)
[How much optimization can one do for a stack machine anyway?  There's no
obvious place to stash common subexpressions. -John]
-- 
Send compilers articles to compilers@iecc.cambridge.ma.us or
{ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.