* [Bug c++/49949] wrong sign for product of complex<double> and double with -O2
2011-08-02 19:19 [Bug c++/49949] New: wrong sign for product of complex<double> and double with -O2 begovic79 at gmail dot com
@ 2011-08-03 9:41 ` rguenth at gcc dot gnu.org
2011-08-03 16:21 ` begovic79 at gmail dot com
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-08-03 9:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49949
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
Last reconfirmed| |2011.08.03 09:40:46
Ever Confirmed|0 |1
--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-08-03 09:40:46 UTC ---
An attachment is missing. Please try to create a small self-contained
testcase using <complex>.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/49949] wrong sign for product of complex<double> and double with -O2
2011-08-02 19:19 [Bug c++/49949] New: wrong sign for product of complex<double> and double with -O2 begovic79 at gmail dot com
2011-08-03 9:41 ` [Bug c++/49949] " rguenth at gcc dot gnu.org
@ 2011-08-03 16:21 ` begovic79 at gmail dot com
2011-08-03 16:28 ` redi at gcc dot gnu.org
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: begovic79 at gmail dot com @ 2011-08-03 16:21 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49949
--- Comment #2 from Ilker R Capoglu <begovic79 at gmail dot com> 2011-08-03 16:20:53 UTC ---
(In reply to comment #1)
> An attachment is missing. Please try to create a small self-contained
> testcase using <complex>.
Sorry, I think it didn't get uploaded because it was above 1000k. I'll try and
get a smaller .ii file.
Thanks!
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/49949] wrong sign for product of complex<double> and double with -O2
2011-08-02 19:19 [Bug c++/49949] New: wrong sign for product of complex<double> and double with -O2 begovic79 at gmail dot com
2011-08-03 9:41 ` [Bug c++/49949] " rguenth at gcc dot gnu.org
2011-08-03 16:21 ` begovic79 at gmail dot com
@ 2011-08-03 16:28 ` redi at gcc dot gnu.org
2011-08-03 16:33 ` begovic79 at gmail dot com
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: redi at gcc dot gnu.org @ 2011-08-03 16:28 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49949
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-08-03 16:27:23 UTC ---
http://gcc.gnu.org/wiki/A_guide_to_testcase_reduction is useful
if you can't reduce it then using gzip or bzip2 might make it small enough to
attach
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/49949] wrong sign for product of complex<double> and double with -O2
2011-08-02 19:19 [Bug c++/49949] New: wrong sign for product of complex<double> and double with -O2 begovic79 at gmail dot com
` (2 preceding siblings ...)
2011-08-03 16:28 ` redi at gcc dot gnu.org
@ 2011-08-03 16:33 ` begovic79 at gmail dot com
2011-08-03 16:34 ` begovic79 at gmail dot com
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: begovic79 at gmail dot com @ 2011-08-03 16:33 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49949
--- Comment #4 from Ilker R Capoglu <begovic79 at gmail dot com> 2011-08-03 16:32:47 UTC ---
(In reply to comment #3)
> http://gcc.gnu.org/wiki/A_guide_to_testcase_reduction is useful
>
> if you can't reduce it then using gzip or bzip2 might make it small enough to
> attach
I actually read the instructions very carefully and managed to go through a lot
of it. The problem is that (a) I'm not so familiar with the internals of the
blitz++ library to prune out the crud effectively (b) the STL headers are
buried so deep into blitz++ that it takes a blitz++ developer to take them out.
I'll try to gzip the file and resubmit, though.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/49949] wrong sign for product of complex<double> and double with -O2
2011-08-02 19:19 [Bug c++/49949] New: wrong sign for product of complex<double> and double with -O2 begovic79 at gmail dot com
` (3 preceding siblings ...)
2011-08-03 16:33 ` begovic79 at gmail dot com
@ 2011-08-03 16:34 ` begovic79 at gmail dot com
2011-09-28 15:11 ` paolo.carlini at oracle dot com
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: begovic79 at gmail dot com @ 2011-08-03 16:34 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49949
--- Comment #5 from Ilker R Capoglu <begovic79 at gmail dot com> 2011-08-03 16:34:31 UTC ---
Created attachment 24906
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24906
The preprocessed file with the STL and blitz++ headers. (bzip2'd)
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/49949] wrong sign for product of complex<double> and double with -O2
2011-08-02 19:19 [Bug c++/49949] New: wrong sign for product of complex<double> and double with -O2 begovic79 at gmail dot com
` (4 preceding siblings ...)
2011-08-03 16:34 ` begovic79 at gmail dot com
@ 2011-09-28 15:11 ` paolo.carlini at oracle dot com
2011-09-28 15:36 ` paolo.carlini at oracle dot com
` (7 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-09-28 15:11 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49949
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |NEW
--- Comment #6 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-09-28 14:57:26 UTC ---
I can reproduce the problem with gcc4.5.x and 4.6.x, but mainline (would be
4.7.0) is fine. Did it ever work for you with older compilers? Because if isn't
a regression, I'm afraid that not much will happen. But would be still
interesting to understand what fixed the problem in mainline...
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/49949] wrong sign for product of complex<double> and double with -O2
2011-08-02 19:19 [Bug c++/49949] New: wrong sign for product of complex<double> and double with -O2 begovic79 at gmail dot com
` (5 preceding siblings ...)
2011-09-28 15:11 ` paolo.carlini at oracle dot com
@ 2011-09-28 15:36 ` paolo.carlini at oracle dot com
2011-09-28 15:58 ` hjl.tools at gmail dot com
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-09-28 15:36 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49949
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hjl.tools at gmail dot com
Severity|minor |normal
--- Comment #7 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-09-28 15:10:47 UTC ---
HJ, any chance you can find what fixed this? Doesn't seem a regression, but
it's an annoying issue anyway, if the patch is simple...
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/49949] wrong sign for product of complex<double> and double with -O2
2011-08-02 19:19 [Bug c++/49949] New: wrong sign for product of complex<double> and double with -O2 begovic79 at gmail dot com
` (6 preceding siblings ...)
2011-09-28 15:36 ` paolo.carlini at oracle dot com
@ 2011-09-28 15:58 ` hjl.tools at gmail dot com
2011-09-28 16:14 ` paolo.carlini at oracle dot com
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: hjl.tools at gmail dot com @ 2011-09-28 15:58 UTC (permalink / raw)
To: gcc-bugs
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)?
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/49949] wrong sign for product of complex<double> and double with -O2
2011-08-02 19:19 [Bug c++/49949] New: wrong sign for product of complex<double> and double with -O2 begovic79 at gmail dot com
` (7 preceding siblings ...)
2011-09-28 15:58 ` hjl.tools at gmail dot com
@ 2011-09-28 16:14 ` paolo.carlini at oracle dot com
2011-09-28 18:24 ` hjl.tools at gmail dot com
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-09-28 16:14 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49949
--- Comment #9 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-09-28 16:02:05 UTC ---
HJ, I think the correct output, showing that we are *not* miscompiling or
something is:
(-0.0,-1.0)x100.0=(-0.0,-100.0)
exactly what you are seeing. The problem is, with 4.6 we get:
(-0.0,-1.0)x100.0=(0.0,100.0)
which is wrong. When that changed?
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/49949] wrong sign for product of complex<double> and double with -O2
2011-08-02 19:19 [Bug c++/49949] New: wrong sign for product of complex<double> and double with -O2 begovic79 at gmail dot com
` (8 preceding siblings ...)
2011-09-28 16:14 ` paolo.carlini at oracle dot com
@ 2011-09-28 18:24 ` hjl.tools at gmail dot com
2011-09-29 15:29 ` paolo.carlini at oracle dot com
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: hjl.tools at gmail dot com @ 2011-09-28 18:24 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49949
--- Comment #10 from H.J. Lu <hjl.tools at gmail dot com> 2011-09-28 18:03:50 UTC ---
It is fixed by revision 172430:
http://gcc.gnu.org/ml/gcc-cvs/2011-04/msg00625.html
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/49949] wrong sign for product of complex<double> and double with -O2
2011-08-02 19:19 [Bug c++/49949] New: wrong sign for product of complex<double> and double with -O2 begovic79 at gmail dot com
` (9 preceding siblings ...)
2011-09-28 18:24 ` hjl.tools at gmail dot com
@ 2011-09-29 15:29 ` paolo.carlini at oracle dot com
2011-09-29 15:40 ` paolo.carlini at oracle dot com
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-09-29 15:29 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49949
--- Comment #11 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-09-29 15:26:30 UTC ---
Doesn't seem to make much sense, but thanks, anyway.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/49949] wrong sign for product of complex<double> and double with -O2
2011-08-02 19:19 [Bug c++/49949] New: wrong sign for product of complex<double> and double with -O2 begovic79 at gmail dot com
` (10 preceding siblings ...)
2011-09-29 15:29 ` paolo.carlini at oracle dot com
@ 2011-09-29 15:40 ` paolo.carlini at oracle dot com
2011-09-30 16:57 ` hubicka at ucw dot cz
2011-09-30 20:49 ` paolo.carlini at oracle dot com
13 siblings, 0 replies; 15+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-09-29 15:40 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49949
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hubicka at gcc dot gnu.org
--- Comment #12 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-09-29 15:27:56 UTC ---
Maybe Honza has ideas about this...
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/49949] wrong sign for product of complex<double> and double with -O2
2011-08-02 19:19 [Bug c++/49949] New: wrong sign for product of complex<double> and double with -O2 begovic79 at gmail dot com
` (11 preceding siblings ...)
2011-09-29 15:40 ` paolo.carlini at oracle dot com
@ 2011-09-30 16:57 ` hubicka at ucw dot cz
2011-09-30 20:49 ` paolo.carlini at oracle dot com
13 siblings, 0 replies; 15+ messages in thread
From: hubicka at ucw dot cz @ 2011-09-30 16:57 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49949
--- Comment #13 from Jan Hubicka <hubicka at ucw dot cz> 2011-09-30 16:26:46 UTC ---
> Maybe Honza has ideas about this...
That patch affect inlining decisions, but should not affect correctness. So it
seems that the bug whatever it is just gone latent.
Honza
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/49949] wrong sign for product of complex<double> and double with -O2
2011-08-02 19:19 [Bug c++/49949] New: wrong sign for product of complex<double> and double with -O2 begovic79 at gmail dot com
` (12 preceding siblings ...)
2011-09-30 16:57 ` hubicka at ucw dot cz
@ 2011-09-30 20:49 ` paolo.carlini at oracle dot com
13 siblings, 0 replies; 15+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-09-30 20:49 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49949
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org,
| |paolo.carlini at oracle dot
| |com
--- Comment #14 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-09-30 20:27:36 UTC ---
Hug :( We should really distill a much, much smaller snippet and analyze what
is really going wrong. Maybe Jakub could help?
^ permalink raw reply [flat|nested] 15+ messages in thread