X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f From: Kbwms AT aol DOT com Message-ID: <176.1f7b2c00.2c925cd7@aol.com> Date: Thu, 11 Sep 2003 19:18:47 EDT Subject: Re: Arithmetic Exceptions in C99 To: djgpp-workers AT delorie DOT com MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="part1_176.1f7b2c00.2c925cd7_boundary" X-Mailer: 8.0 for Windows sub 6015 Reply-To: djgpp-workers AT delorie DOT com --part1_176.1f7b2c00.2c925cd7_boundary Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit In a message dated 9/3/2003 10:38:04 AM Eastern Standard Time, rudd AT cyberoptics DOT com writes: > If we are thinking about using the exception mechanism, we should > consider how it will affect the "builtin" math functions. For instance, > if you invoke sqrt() in a C program, and don't compile with > -fno-builtin, the compiler will first try to compute the square root by > simply using the fsqrt instruction. If something goes wrong (for > instance, for a negative argument), the library routine is called, > because it presumably has the particular error handling that is > appropriate. We need to make sure that this mechanism still works. > I have not been able to confirm this because my test driver is able to call sqrtl() every time regardless of whether -fno-builtin is used. On the other hand, if I write at the top of my program #define sqrtl(x) __builtin_sqrtl(x) then the builtin gets called except when "something goes wrong" as Eric puts it. Thank you, Eric Rudd, for bringing up the topic of builtins. After reviewing my code in sqrtl(), it was clear that some rearrangement of the code is in order. KB Williams --part1_176.1f7b2c00.2c925cd7_boundary Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable In a message dated 9/3/2003 10:38:04 AM Eastern Standard= Time, rudd AT cyberoptics DOT com writes:

If we are thinking about using the exception mechanism, we=20= should
consider how it will affect the "builtin" math functions.  For instance= ,
if you invoke sqrt() in a C program, and don't compile with
-fno-builtin, the compiler will first try to compute the square root by
simply using the fsqrt instruction.  If something goes wrong (for
instance, for a negative argument), the library routine is called,
because it presumably has the particular error handling that is
appropriate.  We need to make sure that this mechanism still works.


I have not been able to confirm this because my test driver is able to call=20= sqrtl() every time regardless of whether
-fno-builtin is u= sed.  On the other hand, if I write at the top of my program

#define sqrtl(x)   __builtin_sqrtl(x)

then the builtin gets called except when "
something goes wrong" as Eric puts it.

Thank you, Eric Rudd, for bringing up the topic of builtins.  After rev= iewing my code in sqrtl(), it was clear that some rearrangement of the code=20= is in order.


KB Williams
--part1_176.1f7b2c00.2c925cd7_boundary--