This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gdb/500: math func sqrt(x) returns NaN for x>=0 in GDB, GNU/Linux i686


The following reply was made to PR gdb/500; it has been noted by GNATS.

From: Daniel Jacobowitz <drow@mvista.com>
To: falk@whoi.edu
Cc: gdb-gnats@sources.redhat.com
Subject: Re: gdb/500: math func sqrt(x) returns NaN  for x>=0 in GDB, GNU/Linux i686
Date: Thu, 18 Apr 2002 12:59:58 -0400

 On Thu, Apr 18, 2002 at 04:34:29PM -0000, falk@whoi.edu wrote:
 > 
 > >Number:         500
 > >Category:       gdb
 > >Synopsis:       math func sqrt(x) returns NaN  for x>=0 in GDB, GNU/Linux i686
 > >Confidential:   no
 > >Severity:       non-critical
 > >Priority:       low
 > >Responsible:    unassigned
 > >State:          open
 > >Class:          sw-bug
 > >Submitter-Id:   net
 > >Arrival-Date:   Thu Apr 18 09:38:01 PDT 2002
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     Falk Feddersen
 > >Release:        GDB 5.0rh  (running Red Hat 7.2)
 > >Organization:
 > >Environment:
 > Red Hat 7.2 Linux on i686
 > >Description:
 > program compiled in gcc w/ flags "-g -march=i686"
 > 
 >  double q,x=0;
 > ....
 >  q=sqrt(x);  /* returns q=NaN in GDB */
 > 
 > if I don't compile w/ "-march=i686" flag it works fine in GDB
 > w/ the -march=i686 flag, q=sqrt(x) works when run regularly.
 
 Please try a current GDB snapshot from http://sources.redhat.com/gdb/current/.
 A bug relating to floating point corruption was fixed recently, and
 this may be the same bug.
 
 (-march=i686 causes sqrt to be expanded inline via __builtin_sqrt,
 instead of a function call; that's why there's a difference.)
 
 -- 
 Daniel Jacobowitz                           Carnegie Mellon University
 MontaVista Software                         Debian GNU/Linux Developer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]