This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Converting the gcc backend to a library?
- To: Mikael Djurfeldt <djurfeldt at nada dot kth dot se>
- Subject: Re: Converting the gcc backend to a library?
- From: Per Bothner <per at bothner dot com>
- Date: 26 Dec 1999 11:11:42 -0800
- Cc: gcc at gcc dot gnu dot org
- References: <E122InR-0002L9-00@mdj.nada.kth.se>
Mikael Djurfeldt <mdj@mdj.nada.kth.se> writes:
> I'd like to write a front-end which transforms the source language
> into RTL, calls the backend to produce object code, and loads it.
No, you don't want to do that. What you want to do is to write a
front-end which transforms the source language into *tree nodes*,
calls the backend to produce object code, and loads it.
(It's a common mis-understanding that RTL is the interface between
the front-end and the back-end. It is not, and promises to
becomes less and less so as we move more functionality and
optimizations to work on trees instead of rtl.)
One complication is that Gcc is chock-full of global variables,
and thus a hypothetical Gcc library cannot be called re-entrantly.
If your application has multiple threads, the Gcc back-end
becomes a single resource suppisbly subject to contention.
--
--Per Bothner
per@bothner.com http://www.bothner.com/~per/