[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Tinycc-devel] Tinycc issues
From: |
Dominic Mazzoni |
Subject: |
[Tinycc-devel] Tinycc issues |
Date: |
Tue, 15 Mar 2005 14:17:36 -0800 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040616 |
Greetings to Fabrice Bellard et al.:
I just tried out tinycc for the first time and I'm very excited about its
potential. It exceeded all of my expectations in terms of compilation
speed (more than 20x faster than gcc for my 10,000-line library) and the
code it produces is pretty good.
My long-term interest in tinycc is for scientific programming; I think
that libtcc could make a great just-in-time function compiler. For now,
though, I'm just experimenting with using it as a replacement for gcc for
some of my existing numerical code.
Here are a couple of issues I ran into. It is quite possible that some of
these are due to ways that gcc differs from the C99 spec. So I don't mean
to imply that these are necessarily bugs in tinycc (except for one that
causes tinycc to crash, see below) - perhaps they should just be known
incompatibilities with gcc that could be listed somewhere.
1. NaN in floating-point constants:
It is sometimes appropriate for a user-defined numerical function to
return NaN. Normally I do this by defining a constant in my code, like
this:
float NAN_FLOAT = (float)(0.0 / 0.0);
Tinycc gives me the error message: "division by zero in constant". To
work around this, I tried to do it in two steps:
float ZERO_FLOAT = (float)(0.0);
float NAN_FLOAT = (float)(ZERO_FLOAT / 0.0);
This actually causes tinycc to crash.
2. Forward-declare arrays:
With gcc, I am allowed to forward-declare an array of unspecified size,
and then actually specify the size (implicitly) later in the code. For
example:
int g_primes[];
...
int g_primes[] = {2, 3, 5, 7, 11, 13, 17, 23};
In tinycc, I get the error message: "unknown type size".
Thanks for listening! I would be more than happy to send more information
if you need it.
Regards,
Dominic
- [Tinycc-devel] Tinycc issues,
Dominic Mazzoni <=