This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Converting the gcc backend to a library?


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]