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 target/44632] [4.4/4.5/4.6 regression] wrong code for complex division



------- 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


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