intermediate code

Rupert Wood me@rupey.net
Thu Nov 1 03:35:00 GMT 2001


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.



More information about the Gcc-help mailing list