[Top][All Lists]

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

Re: [Tinycc-devel] what are tcc's limitations?

From: Bernhard Fischer
Subject: Re: [Tinycc-devel] what are tcc's limitations?
Date: Mon, 16 Oct 2006 11:40:41 +0200
User-agent: Mutt/1.5.13 (2006-08-11)


On Sun, Oct 15, 2006 at 01:19:44AM -0400, Rob Landley wrote:
>On Friday 13 October 2006 3:16 pm, Bernhard Fischer wrote:
>> On Sun, Oct 15, 2006 at 02:02:57AM +0800, bj wrote:
>> >so TinyCC is small,quick,dirty, and a good translator?
>> >
>> >i didn't understand what you meant by these statements:
>> 1) Fix your time
>> 2) tcc has no noteworthy code optimizations. It's main purpose is it's
>> size, not necessarily the quality (speed/size) of the generated code.
>Don't forget speed.  The compiler is small, the compiler is simple, and the 
>compiler runs very very fast.  This doesn't mean that the code the compiler 
>produces does any of those things.
>> 3) tcc is a C89 compiler, for the most part. Anyone who thinks he's able
>> to compile e.g. the kernel or other SW that peruses certain C99 features
>> is likely to be surprised.
>Says who?  According to the docs it's missing complex/imaginary numbers, and 
>variable length arrays.

So what? "SW that peruses certain C99 features" implies that C99 support
is not completed yet. Do you argue that the link you cite above is incorrect
and the code has full C99 support?
>Adding variable length arrays is important.  I don't personally care about 
>complex numbers.  What else is missing?

There is a TODO that list other missing bits, IIRC.
>> That said, even if the majority of C89 is 
>> supported currently, there are a couple of loose ends even with C89.
>Such as?

Again, see TODO
>It has _bugs_, but C89 claims to be feature-complete.

"bugs" != "loose ends" ?

Consider this invalid code:
$ cat no.c
int main(void) {}
$ tcc -o no no.c && ./no ; echo $? ; ./no ; echo $?

That's what i mean with "loose ends" ;)
>> >Nobody wants to use GCC with -O0 instead of -O2, but this is what you get
>> >from TinyCC
>> As said, tcc doesn't optimize, i.e. it behaves roughly like -O0
>Again, the documentation says this isn't entirely true:

roughly != exactly, but ok. Let me rephrase this as
tcc has fewer optimizations than e.g. gcc ..

>I'm still reading the code, and expect to be for some time.  (And then I plan 
>to spend some time untangling it so it's easier to read...)
>> >When GCC is a good human translator, TinyCC is babelfish.altavista.com
>> tcc generates suboptimal code, size wise as well as performance wise as
>> it's main goal is it's _own_ size as opposed to _creating_ small obj.
>It seems to me that its main goal has been to be really fast for about a year 
>and a half now, so the -run mode is a viable scripting language.

Well, i assume it's initial goal was to be small. tinycc, not fastcc :)


reply via email to

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