<s>
The	O
Tiny	B-Language
C	I-Language
Compiler	I-Language
(	O
a.k.a.	O
</s>
<s>
TCC	O
,	O
tCc	O
,	O
or	O
TinyCC	B-Language
)	O
is	O
an	O
x86	B-Operating_System
,	O
X86-64	B-Device
and	O
ARM	B-Architecture
processor	I-Architecture
C	B-Language
compiler	B-Language
initially	O
written	O
by	O
Fabrice	O
Bellard	O
.	O
</s>
<s>
Windows	B-Application
operating	I-Application
system	I-Application
support	O
was	O
added	O
in	O
version	O
0.9.23	O
(	O
17	O
Jun	O
2005	O
)	O
.	O
</s>
<s>
TCC	O
is	O
distributed	O
under	O
the	O
GNU	B-Application
Lesser	I-Application
General	I-Application
Public	I-Application
License	I-Application
.	O
</s>
<s>
TCC	O
claims	O
to	O
implement	O
all	O
of	O
ANSI	O
C	B-Language
(	O
C89/C90	O
)	O
,	O
much	O
of	O
the	O
C99	B-Language
ISO	O
standard	O
,	O
and	O
many	O
GNU	B-Application
C	I-Application
extensions	O
including	O
inline	O
assembly	B-Language
.	O
</s>
<s>
TCC	O
has	O
a	O
number	O
of	O
features	O
that	O
differentiate	O
it	O
from	O
other	O
current	O
C	B-Language
compilers	B-Language
:	O
</s>
<s>
Its	O
small	O
file	O
size	O
(	O
about	O
100KB	O
for	O
the	O
x86	B-Operating_System
TCC	O
executable	O
)	O
and	O
memory	O
footprint	O
allow	O
it	O
to	O
be	O
used	O
directly	O
from	O
a	O
single	O
1.44M	B-Device
floppy	B-Device
disk	I-Device
,	O
such	O
as	O
a	O
rescue	O
disk	O
.	O
</s>
<s>
TCC	O
is	O
intended	O
to	O
produce	O
native	O
x86	B-Operating_System
,	O
x86-64	B-Device
and	O
ARM	B-Architecture
code	O
very	O
quickly	O
;	O
according	O
to	O
Bellard	O
,	O
it	O
compiles	B-Language
,	O
assembles	O
and	O
links	O
about	O
nine	O
times	O
faster	O
than	O
GCC	B-Application
does	O
.	O
</s>
<s>
As	O
of	O
2023	O
,	O
the	O
"	O
mob	O
"	O
development	O
branch	O
also	O
includes	O
support	O
for	O
RISC-V	B-Device
and	O
TMS320C67xx	O
(	O
a	O
DSP	O
chip	O
)	O
.	O
</s>
<s>
TCC	O
has	O
a	O
number	O
of	O
compiler-specific	O
language	O
features	O
intended	O
to	O
improve	O
its	O
practicality	O
,	O
such	O
as	O
an	O
optional	O
memory	O
and	O
bound	O
checker	O
,	O
for	O
improved	O
code	O
stability	O
.	O
</s>
<s>
TCC	O
allows	O
programs	O
to	O
be	O
run	O
automatically	O
at	O
compile	B-Language
time	O
using	O
a	O
command-line	O
switch	O
.	O
</s>
<s>
This	O
allows	O
programs	O
to	O
be	O
run	O
as	O
a	O
shell	O
script	O
under	O
Unix-like	O
systems	O
that	O
support	O
the	O
shebang	B-Operating_System
interpreter	B-Operating_System
directive	I-Operating_System
syntax	O
.	O
</s>
<s>
TCC	O
generates	O
code	O
in	O
a	O
single	O
pass	O
,	O
and	O
does	O
not	O
perform	O
most	O
of	O
the	O
optimizations	B-Application
performed	O
by	O
other	O
compilers	B-Language
.	O
</s>
<s>
TCC	O
compiles	B-Language
every	O
statement	O
on	O
its	O
own	O
,	O
and	O
at	O
the	O
end	O
of	O
each	O
statement	O
register	O
values	O
are	O
written	O
back	O
to	O
the	O
stack	O
and	O
must	O
be	O
re-read	O
even	O
if	O
the	O
next	O
line	O
uses	O
the	O
values	O
in	O
registers	O
(	O
creating	O
extraneous	O
save/load	O
pairs	O
between	O
statements	O
)	O
.	O
</s>
<s>
TCC	O
uses	O
only	O
some	O
of	O
the	O
available	O
registers	O
(	O
e.g.	O
,	O
on	O
x86	B-Operating_System
it	O
never	O
uses	O
ebx	O
,	O
esi	O
,	O
or	O
edi	O
because	O
they	O
need	O
to	O
be	O
preserved	O
across	O
function	O
calls	O
)	O
.	O
</s>
<s>
TCC	O
performs	O
a	O
few	O
optimizations	B-Application
,	O
such	O
as	O
constant	O
propagation	O
for	O
all	O
operations	O
,	O
multiplications	O
and	O
divisions	O
are	O
optimized	O
to	O
shifts	O
when	O
appropriate	O
,	O
and	O
comparison	O
operators	O
are	O
specially	O
optimized	O
(	O
by	O
maintaining	O
a	O
special	O
cache	O
for	O
the	O
processor	O
flags	O
)	O
.	O
</s>
<s>
A	O
recursive	O
Fibonacci	O
algorithm	O
on	O
a	O
1.8GHz	O
Intel	O
Centrino	O
laptop	O
with	O
512MB	O
RAM	B-Architecture
yields	O
a	O
noticeable	O
difference	O
in	O
results	O
between	O
Microsoft	O
Visual	O
C++	O
compiler	B-Language
13.10.3052	O
and	O
TCC	O
.	O
</s>
<s>
To	O
calculate	O
the	O
49th	O
Fibonacci	O
number	O
,	O
it	O
took	O
a	O
MS	O
Visual	O
C++	O
program	O
approximately	O
18%	O
longer	O
than	O
the	O
TCC	O
compiled	B-Language
program	O
.	O
</s>
<s>
A	O
test	O
compared	O
different	O
C	B-Language
compilers	B-Language
by	O
using	O
them	O
to	O
compile	B-Language
the	O
GNU	B-Application
C	I-Application
Compiler	I-Application
(	O
GCC	B-Application
)	O
itself	O
,	O
and	O
then	O
using	O
the	O
resulting	O
compilers	B-Language
to	O
compile	B-Language
GCC	B-Application
again	O
.	O
</s>
<s>
Compared	O
to	O
GCC	B-Application
3.4.2	O
,	O
a	O
TCC	O
modified	O
to	O
compile	B-Language
GCC	B-Application
was	O
able	O
to	O
compile	B-Language
the	O
compiler	B-Language
ten	O
times	O
faster	O
,	O
but	O
the	O
resulting	O
.exe	O
it	O
produced	O
was	O
57%	O
larger	O
,	O
and	O
much	O
slower	O
,	O
taking	O
2.2	O
times	O
as	O
long	O
to	O
compile	B-Language
GCC	B-Application
again.The	O
results	O
were	O
:	O
Running	O
cc1	O
(	O
the	O
GCC	B-Application
C	B-Language
compiler	B-Language
)	O
on	O
itself	O
required	O
518	O
seconds	O
when	O
compiled	B-Language
using	O
GCC	B-Application
3.4.2	O
,	O
545	O
seconds	O
using	O
Microsoft	O
C	B-Language
compiler	B-Language
,	O
and	O
1145	O
seconds	O
using	O
TCC	O
.	O
</s>
<s>
To	O
create	O
these	O
compilers	B-Language
in	O
the	O
first	O
place	O
,	O
GCC	B-Application
(	O
3.4.2	O
)	O
took	O
744	O
seconds	O
to	O
compile	B-Language
the	O
GCC	B-Application
compiler	I-Application
,	O
whereas	O
TCC	O
took	O
only	O
73	O
seconds	O
.	O
</s>
<s>
The	O
level	O
of	O
optimization	O
in	O
each	O
compiler	B-Language
was	O
-O1	O
or	O
similar	O
.	O
</s>
<s>
TCCBOOT	O
,	O
a	O
hack	O
where	O
TCC	O
loads	O
and	O
boots	O
a	O
Linux	B-Operating_System
kernel	I-Operating_System
from	O
source	O
in	O
about	O
10	O
seconds	O
.	O
</s>
<s>
That	O
is	O
to	O
say	O
,	O
it	O
is	O
a	O
"	O
boot	O
loader	O
"	O
that	O
reads	O
Linux	B-Operating_System
kernel	I-Operating_System
source	O
code	O
from	O
disk	O
,	O
writes	O
executable	O
instructions	O
to	O
memory	O
,	O
and	O
begins	O
running	O
it	O
.	O
</s>
<s>
This	O
did	O
require	O
changes	O
to	O
the	O
Linux	B-Operating_System
build	O
process	O
.	O
</s>
<s>
TCC	O
has	O
been	O
used	O
to	O
compile	B-Language
GCC	B-Application
,	O
though	O
various	O
patches	O
were	O
required	O
to	O
make	O
this	O
work	O
.	O
</s>
<s>
It	O
is	O
also	O
used	O
in	O
GNU	B-Application
Guix	I-Application
in	O
an	O
attempt	O
to	O
make	O
the	O
distribution	O
bootstrapable	O
without	O
using	O
any	O
binary	O
.	O
</s>
<s>
Cinpy	O
is	O
a	O
Python	O
library	O
that	O
allows	O
you	O
to	O
implement	O
functions	O
with	O
C	B-Language
in	O
Python	O
modules	O
.	O
</s>
<s>
The	O
functions	O
are	O
compiled	B-Language
with	O
TCC	O
at	O
runtime	O
.	O
</s>
<s>
Comes	O
installed	O
on	O
JavaScript	O
Linux	B-Operating_System
(	O
also	O
by	O
Bellard	O
)	O
.	O
</s>
<s>
Has	O
been	O
used	O
as	O
a	O
reference	O
for	O
the	O
compiled	B-Language
version	O
of	O
the	O
Super	O
Micro-Max	O
Chess	O
program	O
source	O
.	O
</s>
<s>
TCC	O
has	O
its	O
origins	O
in	O
the	O
Obfuscated	O
Tiny	B-Language
C	I-Language
Compiler	I-Language
(	O
OTCC	O
)	O
,	O
a	O
program	O
Bellard	O
wrote	O
to	O
win	O
the	O
International	O
Obfuscated	O
C	B-Language
Code	O
Contest	O
(	O
IOCCC	O
)	O
in	O
2001	O
.	O
</s>
<s>
This	O
includes	O
Dave	O
Dodge	O
's	O
collection	O
of	O
unofficial	O
tcc	O
patches	O
,	O
Debian	O
and	O
kfreebsd	O
downstream	O
patches	O
,	O
and	O
grischka	O
's	O
gcc	B-Application
patches	O
.	O
</s>
<s>
Grischka	O
also	O
set	O
up	O
a	O
public	O
Git	O
repository	O
for	O
the	O
project	O
that	O
contains	O
a	O
mob	O
branch	O
where	O
numerous	O
contributions	O
,	O
including	O
a	O
shared	O
build	O
,	O
cross-compilers	O
,	O
and	O
SELinux	O
compatibility	O
were	O
added	O
.	O
</s>
