NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-alpha/46301: log(3) bugs with positive infinity



The following reply was made to PR port-alpha/46301; it has been noted by GNATS.

From: Nicolas Joly <njoly%pasteur.fr@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: port-alpha-maintainer%netbsd.org@localhost, 
gnats-admin%netbsd.org@localhost,
        netbsd-bugs%netbsd.org@localhost
Subject: Re: port-alpha/46301: log(3) bugs with positive infinity
Date: Sun, 8 Apr 2012 11:27:19 +0200

 On Fri, Apr 06, 2012 at 08:05:01AM +0000, Jukka Ruohonen wrote:
 > >Number:         46301
 > >Category:       port-alpha
 > >Synopsis:       log(3) bugs with positive infinity
 > >Confidential:   no
 > >Severity:       non-critical
 > >Priority:       low
 > >Responsible:    port-alpha-maintainer
 > >State:          open
 > >Class:          sw-bug
 > >Submitter-Id:   net
 > >Arrival-Date:   Fri Apr 06 08:05:00 +0000 2012
 > >Originator:     Jukka Ruohonen
 > >Release:        NetBSD 6.0_BETA
 > >Organization:
 > -
 > >Environment:
 > >Description:
 > 
 > If a value is +Inf, log10f(3), log1pf(3), log2f(3), and logf(3) should
 > return +Inf. But this is not the case with Alpha.
 
 Looks like a compiler issue. The testcases fail when compiled with -O2
 and succeed without.
 
 I can reproduce the very same behaviour with the following sample code
 outside ATF. Both values seems correct, that's the comparison which
 fails.
 
 njoly@thanos [tmp/logf]> cat sample.c
 #include <assert.h>
 #include <math.h>
 
 int main() {
   const float f = 1.0L / 0.0L;
   assert(isinf(f) != 0);
   assert(isinf(logf(f)) != 0);
   assert(logf(f) == f);
   return 0; }
 
 njoly@thanos [tmp/logf]> cc -mieee -O2 -o sample sample.c -lm
 njoly@thanos [tmp/logf]> ./sample; echo $?
 assertion "logf(f) == f" failed: file "sample.c", line 8, function "main"
 zsh: abort (core dumped)  ./sample
 134
 
 njoly@thanos [tmp/logf]> cc -mieee -o sample sample.c -lm
 njoly@thanos [tmp/logf]> ./sample; echo $?
 0
 
 -- 
 Nicolas Joly
 
 Projects and Developments in Bioinformatics
 Institut Pasteur, Paris.
 


Home | Main Index | Thread Index | Old Index