tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] difference between gcc & tcc


From: Evan K. Langlois
Subject: Re: [Tinycc-devel] difference between gcc & tcc
Date: Thu, 31 Mar 2005 13:09:49 -0600

On Thu, 2005-03-31 at 07:45 +0000, amit gupta wrote:
 
can anyone highlight/enumerate the advantages as well as disadvantages of gcc & tcc over each other?
i am researching both the compilers and it wud be helpful if someone could enumerate them to me.

TCC will compile about 12 times faster than GCC, depending on GCC's optimization flags, and produces fairly decent code (about the same as GCC's -O or -O2).  However, if you start passing flags like "-O3 -march=pentium4 -ffast-math" or something to GCC, its going to start using loop-unrolls to keep pipelines full, optimize specifically for a P4, and make use of SIMD instructions in some cases, and the performance will be about double of what you would get with TCC.

For speed comparisons, check out my trials of nbench and a simple recursive fibonacci test with different settings of GCC versus TCC: http://coolrunningconcepts.com/tcc/tcc.html   Note that TCC can compile and run simple tests faster than GCC can do either one!  Its great for some things, but the nbench results show areas where tcc is still a bit lagging.

TCC, while not being the best optimizer, does compile fast, and you can do things like use C as a script language with TCC's #! support (it compiles to memory and runs it on the fly).  Or perhaps you have some special need to compile C functions on the fly and run them from inside your own application ... libtcc can do that.  There is even a project (somewhere) using TCC to compile a linux kernel on boot.

I'm kinda wondering how far this can be taken ... like instead of dynamically loaded kernel modules, maybe dynamically *compiled* and loaded kernel modules, compiled specifically for the hardware that was detected, and further optimized later on in the background or something.

-- Evan Langlois


reply via email to

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