🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #51357

Re: using RTL

#51357
From: Richard Stallman
Date: Tue, 25 May 1993 17:10
28 lines
2042 bytes
The right way to add a new language front end to GCC is to make it
generate the not-quite-syntax-tree data structure defined in tree.h.
That is the input to the language-independent part of GCC.  You should
not try to make RTL directly.

To do this, you must understand that part of GCC.  But if you can
write a compiler, you can do that.

For a front end to generate RTL is undesirable because it is
unmodular.  How to generate RTL depends on the target machine in
complex ways.  You should leave that to the code which already does
it.  The tree data structure is machine-independent aside from a few
storage layout parameters.

The idea of reading this RTL from a file is even worse.  First, the
RTL chain is not the only information that the compiler needs.  So
this is far from the simple task you might imagine.  But even if you
did make it work, reading the RTL would be very slow.  It is just
dumb to make the parser communicate with the rest of the compiler by
passing text through a file.

The right solution is to put the parser in the same process as the
rest of the compiler, and make it generate trees.  This is what
the front ends for Pascal, Fortran, and Ada do.

There is no good documentation for the tree data structure.  If
someone wants to write documentation and give it to the FSF, that
would be useful.
Technical Details
Message-ID: <9305251706.AA21448@mole.gnu.ai.mit.edu>
Path: arc1-ca.pugleaf.net!gmd.de!Germany.EU.net!mcsun!uknet!pipex!uunet!europa.eng.gtefsd.com!howland.reston.ans.net!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!gnu.ai.mit.EDU!rms
References: <9305250955.AA07152@dutiba.twi.tudelft.nl>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,c99e2125e9d82560
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-05-25 11:36:48 PST
Path: arc1-ca.pugleaf.net!gmd.de!Germany.EU.net!mcsun!uknet!pipex!uunet!europa.eng.gtefsd.com!howland.reston.ans.net!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!gnu.ai.mit.EDU!rms
From: rms@gnu.ai.mit.EDU (Richard Stallman)
Newsgroups: gnu.gcc.help
Subject: Re: using RTL
Date: 25 May 1993 13:10:13 -0400
Organization: GNUs Not Usenet
Lines: 28
Sender: daemon@cis.ohio-state.edu
Distribution: gnu
Message-ID: <9305251706.AA21448@mole.gnu.ai.mit.edu>
References: <9305250955.AA07152@dutiba.twi.tudelft.nl>