[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] Mysterious tcc behavior: why does 0.0 takes 12 bytes
From: |
Ivan Popov |
Subject: |
Re: [Tinycc-devel] Mysterious tcc behavior: why does 0.0 takes 12 bytes when NOT long double? |
Date: |
Thu, 26 May 2005 09:44:38 +0200 |
User-agent: |
Mutt/1.4.2.1i |
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