LWN.net Logo

GCC gets a new Optimizer Framework

GCC gets a new Optimizer Framework

Posted May 13, 2004 17:35 UTC (Thu) by Per_Bothner (subscriber, #7375)
In reply to: GCC gets a new Optimizer Framework by rjw
Parent article: GCC gets a new Optimizer Framework

Hopefully [gcj] will be closer integrated into the mainline, and we could see things like compiling a subset of C/ C++ / fortran to JVM bytecode. AFAIK, at the moment, gcj doesn't use all that much of the same code as the other frontends.

The tree-ssa work doesn't change the "integration" of gcj at all - it's as integrated after the tree-ssa merge as it was in 3.4. And it isn't less "integrated" than other languages. It doesn't share code with the C-specific frontends but neither does Fortran.

One way ssa can help gcj is that can make it easier to write high-level optimizers with better knowledge of Java semantics.

Compiling a subset of C/ C++ / Fortran to JVM bytecode is a very hard problem. The logical way to do it is to write a "JVM backend", and so conceptually you'd cross-compile to the JVM. Steve Chamberlain (then) of Transmeta contributed a PicoJava port which has been removed, but it could used as a starting point. Whether something like this would be useful enough to justify the work is a different matter.

I'd be much more interested in "JVM support" for gdb, so it could debug interpreted bytecode.


(Log in to post comments)

GCC gets a new Optimizer Framework

Posted May 16, 2004 12:31 UTC (Sun) by khim (subscriber, #9252) [Link]

Is is "less-integrated". When you compile with GCJ to native code it uses the same front-end. But when you want to compile to JVM - it's whole other compiler! Will it be possible to make JVM just another target ? RTL was unusable for this - but what about SSA ?

GCC gets a new Optimizer Framework

Posted May 20, 2004 9:43 UTC (Thu) by rmathew (guest, #20961) [Link]

Is is "less-integrated". When you compile with GCJ to native code it uses the same front-end. But when you want to compile to JVM - it's whole other compiler! Will it be possible to make JVM just another target ? RTL was unusable for this - but what about SSA ?

First off, RTL has not gone anywhere after the Tree-SSA merge - it is still there, though no longer where almost all of the optimisations are performed.

Second, the actual front end remains the same whether you are compiling to native code or to a class file containing JVM bytecodes - the difference is that JVM bytecodes are generated straight from the tree representation while native code is generated after the trees are converted to RTL and generic and machine-specific optimisations performed.

The main reason is that the GCC infrastructure does not directly support the notion of generating code for two different backends at the same time and it is not trivial to add support for such a thing.

Another reason is probably political.

GCC gets a new Optimizer Framework

Posted May 2, 2005 23:22 UTC (Mon) by plugwash (subscriber, #29694) [Link]

yeah rms is a "Free" software zealot

how much control does he have over gcc nowadays

notice the way he was advocating self-censorship of code in that discussion linked to

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds