[Top][All Lists]

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

Re: [Tinycc-devel] Using TCC as a backbone for our compiler

From: grischka
Subject: Re: [Tinycc-devel] Using TCC as a backbone for our compiler
Date: Mon, 15 Jun 2009 16:57:12 +0200
User-agent: Thunderbird (Windows/20070221)

Jerome St-Louis wrote:
The problem with that however, as I mentioned before, is that the
generated C code makes use of some GCC extensions which I believe are
not available in TCC... (Some very useful stuff for code generation,
such as statements as an expression for example). There's maybe one or
2 of them... One solution would be to implement those and we could
make a lot of progress in that direction.

TCC supports statement expressions, such as:

    return ({ int a=4, b=3; a+b; });

Another problem is that there are some issues with C code generation,
such as required prototyping and reordering of declarations which
causes us many headaches ...

I see.  Actually TCC treats function and struct ptr mismatch as
errors,  however it could be made warnings as needed.

which could get rid of if we were to skip the
intermediate C code.

Assembly would be a little low level however and what you're proposing
of providing an interface for those generators brings up sparkles in
my eyes. We'd be happy to work on that to make it possible to plug at
a more C-like level.

Well, "providing" was maybe misleading.  For TCC we would like to be
able to _use_ such generators, eventually.   Basically we could first
improve the interface of TCC's own generator,  then tune TCC's frontend
such that it can use this interface, and then try to use other generators
alternatively, eventually.  If that makes sense.

Once we have this "improved interface" to TCC's generator it could be
used by your compiler as well, of course.  Including the capability
to run the code JIT or to write out executables for linux and windows.

--- grischka

reply via email to

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