On Thu, May 26, 2005 at 12:11:41AM -0400, David A. Wheeler wrote:
> Here's an odd thing - I've noticed that tcc 0.9.22,
> when compiling itself, writes _12_ bytes, not _8_,
> for the "0.0" in its source code (the last 4 bytes look
> like garbage). It does NOT do this
> with a simple test case that just has 0.0 in it.

TinyCC 0.9.22 fails in my case on one of its own tests, calculating a float
slightly differently than gcc (3.4.2) does.

Namely make test produces:
---------------------------------------------------------------------------
-lltof: 320255972942661.000000 320255972942661.000000 320255972942661.000000
+lltof: 320255981256704.000000 320255972942661.000000 320255972942661.000000
---------------------------------------------------------------------------

corresponding to
---------------------------------------------------------------------------
void llfloat(void)
{
    float fa;
    double da;
    long double lda;
    long long la, lb, lc;
    unsigned long long ula, ulb, ulc;
    la = 0x12345678;
    ula = 0x72345678;
    la = (la << 20) | 0x12345;
    ula = ula << 33;
    printf("la=%Ld ula=%Lu\n", la, ula);

    fa = la;
    da = la;
    lda = la;
    printf("lltof: %f %f %Lf\n", fa, da, lda);
 ...
---------------------------------------------------------------------------

It does not have to be a bug, but it may be related to your observation.

Regards,
--
Ivan



_______________________________________________
Tinycc-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to