This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: intermediate code
- To: "'Florian Hoenig'" <hoenig at liwest dot at>
- Subject: RE: intermediate code
- From: "Rupert Wood" <me at rupey dot net>
- Date: Mon, 12 Nov 2001 07:31:32 -0000
- Cc: <gcc-help at gcc dot gnu dot org>
Florian Hoenig wrote:
> What I have reckognised is, that its 2-tier. frontend for several
> languages und backends fuer quite a lot of architectures.
Three, arguably: language specific front-end, common optimization phase
('middle-end') and target-specific back-end.
> But as far as I know about 2-tier compilers is, that they translate
> highlevel language code to some intermediate code.
GCC's is called 'RTL' and is documented in the manual, e.g.
http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_19.html
> I was just wondering, why not save this code into executables like
> Microsoft's IL, and do JIT compiling with the backend on a choosen
> platform???
There are some advantages to this, e.g. MSVC++ 7 uses an intermediate
language scheme for its 'global optimization' pass. However, there is
already target-specific knowledge in the RTL: both processor specific
(e.g. integer size) and OS specific (definitions from system headers).
It may be possible to compile for an arbitrary 32-bit absolutely-POSIX
machine, though, but this is (AFAIAA) a purely theoretical beast :-)
Furthermore, read/write of an intermediate language (or trivial
bytecode) will probably never happen. RMS is paranoid that commercial
vendors will use an intermediate language to circumvent the GPL and
'steal' GCC technology, e.g. use GCC front end to generate RTL, use
closed-source super-optimisation pass on the RTL and then use GCC
backend to write out the code.
Rup.