This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: csinh bug?
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Steve Ellcey <sellcey at mips dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 14 Mar 2014 13:22:31 -0400
- Subject: Re: csinh bug?
- Authentication-results: sourceware.org; auth=none
- References: <e717b7a1-1385-4520-a745-cce2f4232259 at BAMAIL02 dot ba dot imgtec dot org> <53229049 dot 3030108 at redhat dot com> <1394816699 dot 2556 dot 161 dot camel at ubuntu-sellcey>
On 03/14/2014 01:04 PM, Steve Ellcey wrote:
> On Fri, 2014-03-14 at 01:14 -0400, Carlos O'Donell wrote:
>> On 03/13/2014 02:06 PM, Steve Ellcey wrote:
>>> I am curious if anyone else has seen a problem with the complex hyberbolic
>>> sin function in glibc? I noticed that the GCC test complex_intrinsic_3.f90
>>> was failing for me on MIPS and when I rewrote the test in C it still failed.
>>>
>>> Since the code is basically just generating a call to csinh and MIPS doesn't
>>> have a special implementation of this function, I was wondering if anyone else
>>> has seen this problem on other platforms?
>>
>> I haven't seen it on x86-64, ppc64, s390x, nor aarch64. You'll have to debug
>> the test case to determine what's wrong.
>>
>> Cheers,
>> Carlos.
>
> Thanks for looking at this. I have dug into it some more and it looks
> like it is not a glibc issue at all, it is a GCC bug and the bug is not
> happening when compiling glibc but when compiling my test program. The
> complex constant that I am feeding in to csinh is being written out
> incorrectly by GCC. For some reason this doesn't matter when doing the
> printf before calling csinh but it does affect what gets passed into
> csinh. I have submitted a GCC bug:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60528
Thanks for updating us on the status. For this kind of bug you just have
to pull out the IEEE 754 standard or whatever your machine uses and start
doing bit-for-bit comparisons to make sure what you thought is happening
is actually happening. Tedious, but that's why system's programmers
solve the bear menace.
Cheers,
Carlos.