tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Bug: malloc + function returning double + comparison


From: Michael Matz
Subject: Re: [Tinycc-devel] Bug: malloc + function returning double + comparison between doubles
Date: Sun, 10 Jun 2012 09:15:52 +0200 (CEST)
User-agent: Alpine 2.00 (LNX 1167 2008-08-23)

Hi,

On Sat, 9 Jun 2012, address@hidden wrote:

   d = malloc (s);

If this returns a pointer with upper 32 bits set (which depends on malloc size, fragmentation and moon phase) ...

   d[0] = 10.0;
   i = d[0] > f ();

... those are lost in the caller-save/restore code for the address of d[0] generated because of the call to f. This is because the reload was done in VT_INT mode, not VT_PTR as it should have been.

I fixed it on the mob branch with a hopefully more reliable testcase using alloca (which on x86-64 will always return a pointer with high 32 bit set because the stack will be set up that way).

Thomas: as you were last fiddling with arm, you might want to check if the test works on it. The other alloca testcase is #ifdef'ed on i386 and x86_64, but that only makes sense if alloca really isn't supported on arm, which I can't believe. If that really is the case callsave_test() needs to be conditional too.


Ciao,
Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]