This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/44632] [4.4/4.5/4.6 regression] wrong code for complex division
- From: "danglin at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Aug 2010 19:32:43 -0000
- Subject: [Bug target/44632] [4.4/4.5/4.6 regression] wrong code for complex division
- References: <bug-44632-11764@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from danglin at gcc dot gnu dot org 2010-08-07 19:32 -------
Starting program: /home/dave/gnu/gcc-4.6/objdir/gcc/testsuite/g++/test
(2,0)
Breakpoint 2, 0x000109f8 in f (x=...) at test.cxx:12
12 x = 1.0 / x;
(gdb) step
std::operator/<double> (__x=@0xc0246388, __y=...)
at /home/dave/gnu/gcc/objdir/hppa-linux/libstdc++-v3/include/complex:429
429 complex<_Tp> __r = __x;
(gdb) p &__y
$15 = (const std::complex<double> *) 0xc0246390
(gdb) p &__r
$16 = (std::complex<double> *) 0xc0246390
(gdb) p __y
$17 = (const std::complex<double> &) @0xc0246390: {_M_value = 2 + 0 * I}
(gdb) p __r
$18 = {_M_value = 2 + 0 * I}
(gdb) step
std::complex<double>::complex (this=0xc0246390, __r=1, __i=0)
at /home/dave/gnu/gcc/objdir/hppa-linux/libstdc++-v3/include/complex:1172
1172 __real__ _M_value = __r;
(gdb)
1173 __imag__ _M_value = __i;
(gdb)
1174 }
(gdb)
std::operator/<double> (__x=@0xc0246388, __y=...)
at /home/dave/gnu/gcc/objdir/hppa-linux/libstdc++-v3/include/complex:430
430 __r /= __y;
(gdb) p __y
$19 = (const std::complex<double> &) @0xc0246390: {_M_value = 1 + 0 * I}
(gdb) p __r
$20 = {_M_value = 1 + 0 * I}
The problem is __r and __y share the same location.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44632