Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: "H . J . Lu" <hjl@lucon.org>
To: Zhang Fuxin <fxzhang@ict.ac.cn>
Cc: "linux-mips@oss.sgi.com" <linux-mips@oss.sgi.com>
Subject: Re: another gcc optimization bug?
Date: Tue, 5 Feb 2002 15:44:37 -0800	[thread overview]
Message-ID: <20020205154437.A9605@lucon.org> (raw)
In-Reply-To: <200202051457.g15EvfA12401@oss.sgi.com>; from fxzhang@ict.ac.cn on Tue, Feb 05, 2002 at 10:54:42PM +0800

On Tue, Feb 05, 2002 at 10:54:42PM +0800, Zhang Fuxin wrote:
> hi,
>     It seems gcc with optimization > -O2 will produce incorrect code for fp code:
> I find this example when tracking down the libm-test failures.
>   ( expf(NaN) == NaN will report an extra "invalid operation" exception )
> The faulting code snippet is:
> 	float __my_expf(float x)		/* wrapper expf */
> {
> 	float z;
> 	unsigned int hx;
> 	z = __ieee754_expf(x);
> 	if(_LIB_VERSION == _IEEE_) return z;
> 	if(__finitef(x)) {
> 	    if(x>o_threshold)
> 		return 1.0;
> 	    else if(x<u_threshold)
> 		return 2.0;
>             printf("haha\n");
> 	} 
> 	return z;
> }
> 
> with -O2(or higher),some statements inside "if (__finitef(x))" are put before
> testing the return value of __finitef(x),one of which is a c.lt.s that cause
> the extra "invalid operation" exception being raised.
> 

This bug seem fixed in gcc 3.1.


H.J.

      reply	other threads:[~2002-02-05 23:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-05 14:54 another gcc optimization bug? Zhang Fuxin
2002-02-05 23:44 ` H . J . Lu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020205154437.A9605@lucon.org \
    --to=hjl@lucon.org \
    --cc=fxzhang@ict.ac.cn \
    --cc=linux-mips@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox