tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] libtcc bug when evaluating math expressions


From: Daniel Glöckner
Subject: Re: [Tinycc-devel] libtcc bug when evaluating math expressions
Date: Thu, 27 Nov 2003 17:03:55 +0100
User-agent: Mutt/1.4.1i

On Thu, Nov 27, 2003 at 01:28:45PM +0000, David Wallin wrote:
>   char *eval_me =   "double evaluate_me(double x, double v) { return 
> (double) ((-1.0 * x) > v * fabs(v)); }\0" ;

#include <math.h>

fabs is not defined and so defaults to returning an integer in eax
instead of a double in st0. On exit of fabs(), eax holds an undefined
value which is then converted to a double and multiplied with v.
GCC knows about fabs and generates the fabs instruction, even with -O0.

  Daniel

Attachment: pgp8Xj5G8Hb_F.pgp
Description: PGP signature


reply via email to

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