New compiler - Orange C

bluefish17 <dlindauer@acm.org>
Sat, 10 Apr 2010 21:54:55 -0700 (PDT)

          From comp.compilers

Related articles
New compiler - Orange C dlindauer@acm.org (bluefish17) (2010-04-10)
| List of all articles for this month |

From: bluefish17 <dlindauer@acm.org>
Newsgroups: comp.compilers
Date: Sat, 10 Apr 2010 21:54:55 -0700 (PDT)
Organization: Compilers Central
Keywords: C, available
Posted-Date: 12 Apr 2010 01:31:05 EDT

I'Ve Been Working On A Retargetable (Optimizing) C99 Compiler/
Toolchain For A While... Thought I Would Bring It Up Here Because I
Recently Finished With Basic Optimizations And Thought Maybe Someone
Would Be Interested In Some Of The Algorithms...


Mostly it's basic run of the mill stuff you would find in any
optimizing compiler (bear in mind I haven't progressed beyond single
procedure optimizations)... a lot of it was originally inspired by
Robert Morgan 'Building an Optimizing Compiler' but I did do a couple
of things differently. For example I took the alternate tack with
aliasing info; instead of propagating the aliasing through from the
front end I calculate it from the intermediate code. There is a nice
research paper on this and it works pretty well. Also, I implemented
what I think is a fairly interesting form of lazy code motion from the
research. The third thing I did was take the two major papers on
iterated register coalescing (which is a register allocation
algorithm) and integrate them with a third on generalized register
allocation... to come up with what I think will be a robust way of
handling register allocations for different types of architectures
whenever I get to the point of concentrating more fully on retargeting
the compiler. I had to go a bit beyond Morgan also for an efficient
DOM tree generation algorithm and I wanted at least minimal loop
invariant handling, which I derived from a comment on how Scribble
works...


All this is referenced in the code against the research papers that
led to the algorithms...


To be fair the compiler is retargetable as is, I'm just not satisfied
with the amount of effort it takes to retarget it. Mostly now you
have to hand write a lot of code whereas I'm heading for architecture
description files... anyway if it matters my retargeting design is a
little more friendly to byte and word-oriented architectures than say
GCC or LCC... and it should also handle quad word processors as-is,
but my work in progress is heading toward even better retargetability.


if anyone is interested in taking a peak, the sources for the compiler
are on:


http://members.tripod.com/~ladsoft/orangec.htm


along with binaries for a tool chain using it that runs on and targets
WIN32 and MSDOS.



Post a followup to this message

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