octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #47775] realpow and sparse-xpow.cc-tst fails


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #47775] realpow and sparse-xpow.cc-tst fails
Date: Sun, 01 May 2016 14:58:15 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:46.0) Gecko/20100101 Firefox/46.0

Follow-up Comment #15, bug #47775 (project octave):

Octave already has special code in the xpow functions for integer exponents,
the point is that old versions of gcc is not doing the right thing, and how
much do we care about that when it's already been fixed in gcc 5.

With gcc 4.8:


$ cat cplxtest.cc
#include <complex>
#include <iostream>

int main (int argc, char *argv[])
{
  std::complex<double> x (0, 1);
  int y = 2;

  std::cout << std::pow (x, y) << std::endl;
}
$ g++ cplxtest.cc -o cplxtest    
$ ./cplxtest 
(-1,0)
$ g++ -std=gnu++11 cplxtest.cc -o cplxtest
$ ./cplxtest 
(-1,1.22465e-16)


With gcc 5:


$ g++ cplxtest.cc -o cplxtest
$ ./cplxtest 
(-1,0)
$ g++ -std=gnu++11 cplxtest.cc -o cplxtest
$ ./cplxtest 
(-1,0)


This is clearly a bug in gcc through version 4.8, I understand that this
breaks the realpow function, not just a failing unit test, so I'm not sure
what we should do about this. We could add more configure tests, and disable
the C++11 flags automatically on compilers that have this bug. This would add
more maintenance cost with conditionals for things like std::unique_ptr vs
std::auto_ptr.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?47775>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]