[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: data.cc failing 1 test
From: |
Rik |
Subject: |
Re: data.cc failing 1 test |
Date: |
Thu, 17 Dec 2009 07:02:49 -0800 |
John W. Eaton wrote:
> On 16-Dec-2009, Rik wrote:
>
> | 'make check' is failing for one test in data.cc. I'm pretty sure I was
> | able to pass the entire test suite as little as two weeks ago.
> |
> | >>>>> processing octave-dev/src/data.cc
> | ***** assert(log2(complex(0,Inf)), Inf + log2(i));
> | !!!!! test failed
> | assert (log2 (complex (0, Inf)),Inf + log2 (i)) expected
> | Inf + 2.266i
> | but got
> | Inf - NaNi
> | NaNs don't match
>
> What compiler are you using? What options? For the following
> program, I see the following result with g++ -O0,
>
> $ g++ -O0 cmplx-bug.cc
> $ ./a.out
> inf, (0,inf)
> (inf,nan)
>
> but with -O2, I see
>
> $ g++ -O2 cmplx-bug.cc
> $ ./a.out
> inf, (0,inf)
> (inf,2.26618)
>
> So I think this is a bug in g++ or the complex class in the GNU
> libstdc++ library.
>
> I'm using
>
> $ g++ -v
> Using built-in specs.
> Target: x86_64-linux-gnu
> Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.4-6'
> --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs
> --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared
> --enable-multiarch --enable-linker-build-id --with-system-zlib
> --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
> --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3
> --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug
> --enable-objc-gc --enable-mpfr --with-tune=generic --enable-checking=release
> --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
> Thread model: posix
> gcc version 4.3.4 (Debian 4.3.4-6)
>
> but I also see the same result with g++ 3.3, 4.0, 4.1, and 4.2.
>
> jwe
>
>
Wow. Good catch. I'm using g++ 4.2.4 and it exhibits the same bad
behavior depending on the optimization flag.
--Rik