Developer(s) | Fabrice Bellard |
---|---|
Stable release | 0.9.27
/ December 17, 2017 |
Repository | repo |
Written in | C and Assembly[citation needed] |
Operating system | Linux, Unix, Windows |
Predecessor | OTCC, Obfuscated Tiny C Compiler[1] |
Type | C compiler |
License | LGPLv2.1 |
Website | bellard |
The Tiny C Compiler (a.k.a. TCC, tCc, or TinyCC) is an x86, X86-64 and ARM processor C compiler initially written by Fabrice Bellard. It is designed to work for slow computers with little disk space (e.g. on rescue disks). Windows operating system support was added in version 0.9.23 (17 Jun 2005). TCC is distributed under the GNU Lesser General Public License.
TCC claims to implement all of ANSI C (C89/C90),[2] much of the C99 ISO standard,[3] and many GNU C extensions including inline assembly.
TCC has a number of features that differentiate it from other current C compilers:
In general, TCC's implementation emphasizes smallness instead of optimally-performing results. TCC generates code in a single pass, and does not perform most of the optimizations performed by other compilers. TCC compiles every statement on its own, and at the end of each statement register values are written back to the stack and must be re-read even if the next line uses the values in registers (creating extraneous save/load pairs between statements). TCC uses only some of the available registers (e.g., on x86 it never uses ebx, esi, or edi because they need to be preserved across function calls).[5]
TCC performs a few optimizations, such as constant propagation for all operations, multiplications and divisions are optimized to shifts when appropriate, and comparison operators are specially optimized (by maintaining a special cache for the processor flags). It also does some simple register allocation, which prevents many extraneous save/load pairs inside a single statement.
Here are two benchmark examples:
TCC has its origins in the Obfuscated Tiny C Compiler (OTCC),[1] a program Bellard wrote to win the International Obfuscated C Code Contest (IOCCC) in 2001. After that time, Bellard expanded and deobfuscated the program to produce tcc.[1]
At some time prior to 4 February 2012 Fabrice Bellard updated the project's official web page to report that he was no longer working on TCC.[13]
Since Bellard's departure from the project, various people and groups have distributed patches or maintained forks of TCC to build upon or fix issues with TCC. This includes Dave Dodge's collection of unofficial tcc patches,[14] Debian and kfreebsd downstream patches,[15] and grischka's gcc patches.[6] Grischka also set up a public Git repository for the project[16] that contains a mob branch[17] where numerous contributions, including a shared build, cross-compilers, and SELinux compatibility were added. Grischka's GIT repository later became the official TCC repository (linked to by Fabrice Bellard's Savannah project page [18]).
As of December 2017 both the official TCC mailing list[19] and the official Git repository (as linked to by Fabrice Bellard's Savannah project page[20]) show active discussion and development by many developers and interested users. In December 2017, grischka announced on the mailing list that TCC version 0.9.27 was released.[21]
By: Wikipedia.org
Edited: 2021-06-18 15:17:28
Source: Wikipedia.org