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

Re: tcc



James Knight <jknight@fuhm.net> writes:

> So I've been playing with tcc (Tiny C Compiler
> http://fabrice.bellard.free.fr/tcc/) a bit with the expectation of
> replacing the fork/exec of gcc with a library call to the compiler which
> compiles into the running image. However it does not appear to be ready
> for embedded use yet. The released version compiles once only (which is
> all that's needed for the standard executable), and with some coaxing I
> got it to work two or three times, but then it dies from some cause I
> haven't determined. Most of the state is still stored in global variables
> instead of TCCState, and tcc_delete isn't actually freeing any of the
> memory, and tcc_new isn't actually initializing all the globals it needs
> to. 

we should contact fabrice and tell him how to recreate these
problems.  he's very friendly.

> The C parser seems to be good enough for GOO, however, as it did
> manage to compile all of GOO staticly (but GOO then runs very very
> slowly) as the optimizer isn't anything close to gcc -O2.

it's entirely possible that we'll have to improve g2c to require less
from a cc.  it would be interesting to try a few experiments with
hacked g2c output to see what the difference would be if the c output
were more optimal (e.g., fewer temporaries).  tcc might also not do
any inlining.

jonathan