public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "danglin at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/44632] [4.4/4.5/4.6 regression] wrong code for complex division
Date: Sat, 07 Aug 2010 19:33:00 -0000	[thread overview]
Message-ID: <20100807193243.28395.qmail@sourceware.org> (raw)
In-Reply-To: <bug-44632-11764@http.gcc.gnu.org/bugzilla/>



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


  parent reply	other threads:[~2010-08-07 19:33 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-22 13:58 [Bug target/44632] New: " doko at ubuntu dot com
2010-06-22 14:30 ` [Bug target/44632] " rguenth at gcc dot gnu dot org
2010-06-24 22:03 ` rguenth at gcc dot gnu dot org
2010-08-07 19:14 ` danglin at gcc dot gnu dot org
2010-08-07 19:33 ` danglin at gcc dot gnu dot org [this message]
2010-08-07 19:52 ` [Bug tree-optimization/44632] " danglin at gcc dot gnu dot org
2010-08-07 19:58 ` danglin at gcc dot gnu dot org
2010-08-07 19:59 ` dave at hiauly1 dot hia dot nrc dot ca
2010-08-07 20:37 ` rguenth at gcc dot gnu dot org
2010-08-07 20:39 ` rguenth at gcc dot gnu dot org
2010-08-07 20:40 ` rguenth at gcc dot gnu dot org
2010-08-07 20:57 ` dave at hiauly1 dot hia dot nrc dot ca
2010-08-07 21:00 ` dave at hiauly1 dot hia dot nrc dot ca
2010-08-07 21:04 ` dave at hiauly1 dot hia dot nrc dot ca
2010-08-07 21:16 ` rguenth at gcc dot gnu dot org
2010-08-07 21:36 ` dave at hiauly1 dot hia dot nrc dot ca
2010-08-09 11:35 ` dave at hiauly1 dot hia dot nrc dot ca
2010-08-09 11:37 ` dave at hiauly1 dot hia dot nrc dot ca
2010-08-09 11:44 ` dave at hiauly1 dot hia dot nrc dot ca
2010-08-09 11:51 ` rguenther at suse dot de
2010-08-09 13:18 ` rguenth at gcc dot gnu dot org
2010-08-09 13:31 ` [Bug tree-optimization/44632] [4.4/4.5 " rguenth at gcc dot gnu dot org
2010-08-16 20:18 ` danglin at gcc dot gnu dot org
2010-08-16 20:25 ` danglin at gcc dot gnu dot org
2010-08-16 20:27 ` danglin at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100807193243.28395.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).