Re: A retargetable compiler

Rainer Leupers <>
3 Jun 2001 17:00:58 -0400

          From comp.compilers

Related articles
A retargetable compiler (iaznar) (2001-05-30)
Re: A retargetable compiler (2001-05-31)
Re: A retargetable compiler (Rainer Leupers) (2001-06-03)
| List of all articles for this month |

From: Rainer Leupers <>
Newsgroups: comp.compilers
Date: 3 Jun 2001 17:00:58 -0400
Organization: University of Dortmund, Computer Science 12
References: 01-05-091 01-05-103
Keywords: tools
Posted-Date: 03 Jun 2001 17:00:58 EDT

> > In LANCE documentation speaks about the tools OLIVE and IBURG for
> > make the synthesis, the code generators. I have found IBURG, but I
> > found nothing about OLIVE.
> > ..
> > And, more general, do you thing those are the right tools I need?
> I'm not familiar with OLIVE either, but IBURG (and its sibling BURG)
> might very well be the right tool for you. Iburg is good at finding
> the cheapest - you define the metrics - machine instruction sequence
> for a given tree of intermediate language instructions. This is
> especially useful if there are many alternative translations to choose
> from, as is often the case in CISC processors. If your processor is
> more of a RISC cpu then the problem is probably not so much choosing
> the right instructions, as well as scheduling them. In that case the
> gain from using a code generator generator is less spectacular but it
> will probably save you some time and make your code easier to
> maintain.
> If memory serves me well the lcc c-compiler was done by the authors of
> BURG and uses (I?)BURG in its backend. You may want to have a look at
> that compiler to see a real-world example.

LCC is a very good choice for quickly developing a working C compiler,
but it comprises only few code optimizations, only a local register
allocator and no instruction scheduler. So it's up to your
preferences: "time to market" or code quality. LCC uses LBURG, a
variant of IBURG, for the code selection part, but the difference is
not big.

What actually makes a difference from my experience with IBURG and
OLIVE is that OLIVE provides a much more convenient specification
formalism, since it allows to annotate action functions (similar to
yacc) to the tree grammar rules, and these allow for a very clean and
modular code selector implementation. Another plus of OLIVE is that
the instruction costs are not restricted to integer constants, but
arbitrary C code can be used. This is a nice feature in case of
several non-trivial target machines. In the LANCE system mentioned
above, we have implemented an interface to OLIVE and applied this to a
number of compiler development projects.

I am not aware of any dedicated information on OLIVE on the Web, but
it used to be included in the SPAM compiler package, which can be
downloaded from

It should be noted, though, that IBURG/OLIVE just help to create a
rather small part of a C compiler, namely the code selector. A C
frontend, machine-independent optimizations, as well as register
allocation, scheduling, and peephole optimizations have to be
implemented as well. These things are all supported by the GNU C
compiler gcc, which might be another good choice. However,
retargeting gcc certainly gets difficult, when your target machine is
not as "clean" as a standard RISC or CISC processor.

In addition to the tools mentioned above there exist a number of
"point solutions" for retargetability, that refer to specific
processor classes like VLIW or DSP.

Hope this helps.


Dr. Rainer Leupers
University of Dortmund, Computer Science 12
Otto-Hahn-Str. 16, D-44221 Dortmund, Germany
phone: +49 231 755-6151, fax: -6116, mobile: +49 177 2131146
email (office):,
email (home):

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.