info-sather
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Assembler backend (was: GNU Sather Status)


From: Matthew Browne
Subject: Re: Assembler backend (was: GNU Sather Status)
Date: Mon, 26 Mar 2001 19:21:35 +1200

At 11:20 AM +0300 25/3/2001, Eray Ozkural wrote:
Hi nobbi,

Norbert Nemec wrote:
 So, the way I propose would be to create a modular compiler with a C-backend
 which can then be optionally replaced by a assember backend.

Using an intermediate language is definitely not a wrong thing.
However, C language has its own assumptions, and might not be very effective
as an intermediate language. The affordance here is that C is quite portable.

How about making sather generate intermediate code for a known intermediate
language?

Actually this is quite a problem. The big advantage to using C is
portability, as you say, but there are penalties in performance
and the complexity of both code generation and building the
compiler.

The most obvious candidate to replace C would be the GNU RTL
format used internally by GCC but this is not really suitable
for a number of reasons. Worst of all, the GCC documentation
says "don't do it!". Some compilers still generate RTL anyway
but usually every time there's a new GCC release, they break
and have to be changed. Additionally, in my humble opinion,
RTL is a little too low level to efficiently generate assembly
code for the different CPU architectures.

The compiler will need an intermediate representation for the
program in some form anyway but that doesn't mean it has to be
something as complex as C and it also doesn't mean you can't have
a back end that can generate assembly language. I'd definitely
support Nobbi's suggestion that the backend be replaceable.

Matthew Browne



reply via email to

[Prev in Thread] Current Thread [Next in Thread]