Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Features  





2 Compiled program performance  





3 Uses  





4 History  





5 Current status  





6 See also  





7 References  





8 External links  














Tiny C Compiler






Čeština
Deutsch
فارسی
Français
Italiano

Polski
Русский
Türkçe

 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


Tiny C Compiler
Developer(s)Fabrice Bellard
Stable release

0.9.27 / 17 December 2017; 6 years ago (2017-12-17)

Repositoryrepo.or.cz/w/tinycc.git
Written inC and Assembly[citation needed]
Operating systemLinux, Unix, Windows
PredecessorOTCC, Obfuscated Tiny C Compiler[1]
TypeC compiler
LicenseLGPLv2.1
Websitewww.tinycc.org

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 June 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.

Features[edit]

TCC has a number of features that differentiate it from other current C compilers:

Compiled program performance[edit]

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:

  1. A recursive Fibonacci algorithm on a 1.8 GHz Intel Centrino laptop with 512 MBRAM yields a noticeable difference in results between Microsoft Visual C++ compiler 13.10.3052 and TCC. To calculate the 49th Fibonacci number, it took a MS Visual C++ program approximately 18% longer than the TCC compiled program.[citation needed]
  2. A test compared different C compilers by using them to compile the GNU C Compiler (GCC) itself, and then using the resulting compilers to compile GCC again. Compared to GCC 3.4.2, a TCC modified to compile GCC was able to compile the compiler ten times faster, but the resulting .exe it produced was 57% larger, and much slower, taking 2.2 times as long to compile GCC again.[6]

    The results were: Running cc1 (the GCC C compiler) on itself required 518 seconds when compiled using GCC 3.4.2, 545 seconds using Microsoft C compiler, and 1145 seconds using TCC. To create these compilers in the first place, GCC (3.4.2) took 744 seconds to compile the GCC compiler, whereas TCC took only 73 seconds. The level of optimization in each compiler was -O1 or similar.

Uses[edit]

History[edit]

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.[15]

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,[16] Debian and kfreebsd downstream patches,[17] and grischka's gcc patches.[6] Grischka also set up a public Git repository for the project[18] that contains a mob branch[19] 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 [20]).

Current status[edit]

As of December 2017 both the official TCC mailing list[21] and the official Git repository (as linked to by Fabrice Bellard's Savannah project page[22]) 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.[23]

See also[edit]

References[edit]

  • ^ According to the project's TODO list complex types are the only missing C99 feature. Variable Length Arrays have been added in TCC 0.9.26
  • ^ "TCC : Tiny C Compiler". bellard.org. Retrieved 27 March 2023.
  • ^ Glöckner, Daniel. Re: Tinycc-devel (no subject), 8 September 2006.
  • ^ a b grischka, GCC by TCC (some fixes), 29 September 2005
  • ^ "TCCBOOT: TinyCC Boot Loader". bellard.org. Retrieved 27 March 2023.
  • ^ "tinycc-devel (thread)". lists.gnu.org. Retrieved 27 March 2023.
  • ^ Wheeler, David A. Countering Trusting Trust through Diverse Double-Compiling. ACSAC.
  • ^ "Guix Further Reduces Bootstrap Seed to 25% — 2020 — Blog — GNU Guix".
  • ^ "Bootstrappable builds". bootstrappable.org. Retrieved 29 March 2023.
  • ^ "Cinpy". Archived from the original on 20 November 2008. Retrieved 27 March 2023.
  • ^ "JSLinux". bellard.org. Retrieved 27 March 2023.
  • ^ "Super Micro Chess". SourceForge. Retrieved 27 March 2023.
  • ^ "TCC : Tiny C Compiler". 4 February 2012. Archived from the original on 4 February 2012. Retrieved 27 March 2023.
  • ^ "Unofficial tcc Patches". www.dododge.net. Archived from the original on 31 March 2007. Retrieved 27 March 2023.
  • ^ "Debian -- Details of package tcc in sid". packages.debian.org. Retrieved 27 March 2023.
  • ^ grischka, Public Git Hosting for tcc
  • ^ grischka, mob branch for tcc
  • ^ "Tiny C Compiler - Summary [Savannah]". savannah.nongnu.org. Retrieved 27 March 2023.
  • ^ "tinycc-devel Archives". lists.gnu.org. Retrieved 27 March 2023.
  • ^ "Public Git Hosting - tinycc.git/summary". repo.or.cz. Retrieved 27 March 2023.
  • ^ "[Tinycc-devel] TCC version 0.9.27 is out". lists.nongnu.org. Retrieved 27 March 2023.
  • External links[edit]


    Retrieved from "https://en.wikipedia.org/w/index.php?title=Tiny_C_Compiler&oldid=1217223273"

    Categories: 
    C (programming language) compilers
    Free compilers and interpreters
    Free software programmed in C
    Software using the LGPL license
    Assembly language software
    Hidden categories: 
    Articles with short description
    Short description is different from Wikidata
    Use dmy dates from June 2023
    All articles with unsourced statements
    Articles with unsourced statements from September 2020
    Articles with unsourced statements from February 2008
     



    This page was last edited on 4 April 2024, at 15:15 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki