This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug math/4522] New: SH- Mathematical Error handling is no working for valid code
- From: "dilip dot ramesh at kpitcummins dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 18 May 2007 12:31:38 -0000
- Subject: [Bug math/4522] New: SH- Mathematical Error handling is no working for valid code
- Reply-to: sourceware-bugzilla at sourceware dot org
Hello all,
I have successfully built SH4-Linux toolchain based on
(binutils-2.17, gcc-4.2-20061205, glibc-2.5) for Renesas SH
target.
I am facing problem while executing the following C++
program.
------------------------------------------------------------------
#include <stdio.h>
#include <cmath>
#include <cerrno>
double value;
int main( void )
{
value = sqrt(-1.2);
if (errno != EDOM) {
printf("sqrt: GOT %f\n", value);
}
}
------------------------------------------------------------------
The above program compiles successfully with the sh4-linux
toolchain.
While executing on target platform "sqrt" function is returning "nan" but
"errno" variable is not set to "EDOM".
Command: sh4-linux-gcc <name> {here default target is m4}
Observations:
1. When the above program is compiled with "-m4-nofpu" target option or with
any other FPU less target option program executes successfully and the
"errno" variable is set to "EDOM".
Command: sh4-linux-gcc -m4-nofpu <name>
Is there any relation with the target processor (i.e. floating point unit
processor or non - floating point unit processor)? Because the only difference
between success and failure condition in our case is the target switch we are
specifying (m4-nofpu or m4 respectively ).
Any help on this will be appreciated.
Regards,
Dilip Malinur Ramesh
KPIT Cummins Infosystems Ltd,
Pune (INDIA)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Free download of GNU based SH-Linux toolchains for Renesas' SH
Series.
The following site also offers free technical support to its
users.
Visit http://www.kpitgnutools.com for details.
Latest versions of KPIT GNU SH-Linux tools were released on April 5,
2007.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
Summary: SH- Mathematical Error handling is no working for valid
code
Product: glibc
Version: unspecified
Status: NEW
Severity: critical
Priority: P3
Component: math
AssignedTo: aj at suse dot de
ReportedBy: dilip dot ramesh at kpitcummins dot com
CC: dilip dot ramesh at kpitcummins dot com,glibc-bugs at
sources dot redhat dot com
GCC build triplet: i686-pc-linux
GCC host triplet: sh4-unknown-linux
GCC target triplet: sh4-unknown-linux
http://sourceware.org/bugzilla/show_bug.cgi?id=4522
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.