This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/49949] wrong sign for product of complex<double> and double with -O2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49949

--- Comment #8 from H.J. Lu <hjl.tools at gmail dot com> 2011-09-28 15:54:09 UTC ---
(In reply to comment #0)
> With the -O2 flag and in a very specialized circumstance, the product of a
> complex<double> and a double has the wrong sign.
> 
> The problem arises when the blitz++ array library is used.
> (http://www.oonumerics.org/blitz/) Unfortunately, I could not prune out all the
> references to the unnecessary C++ standard libraries. The size of the .ii file
> is therefore pretty big. I hope the report will still be useful.
> 
> The output of the executable gcc_complex_bug should be
> 
> (-0.0,-1.0)x100.0=(0.0,100.0)
> 

I also got

(-0.0,-1.0)x100.0=(-0.0,-100.0)

with GCC 4.7.0 revision 179164.  Why should we get (0.0,100.0)?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]