public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/50957] [C++0x][constexpr] complex<T> ctor drops sign of zero (sometimes)
Date: Wed, 02 Nov 2011 09:37:00 -0000	[thread overview]
Message-ID: <bug-50957-4-mIym08VwB5@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-50957-4@http.gcc.gnu.org/bugzilla/>

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
           Keywords|                            |wrong-code
   Last reconfirmed|                            |2011-11-02
          Component|libstdc++                   |c++
                 CC|                            |jason at gcc dot gnu.org
     Ever Confirmed|0                           |1
            Summary|complex<T> ctor drops sign  |[C++0x][constexpr]
                   |of zero (sometimes)         |complex<T> ctor drops sign
                   |                            |of zero (sometimes)
      Known to fail|                            |4.6.2

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-11-02 09:36:44 UTC ---
Confirmed.  Looks like a frontend issue (probably related to constexpr?).
In .initial we have

{
  struct mock_complex z1 = {._M_real=-0.0, ._M_imag=1.0e+0};
  struct complex z2 = {._M_value=__complex__ (0.0, 1.0e+0)};

  <<cleanup_point   struct mock_complex z1 = {._M_real=-0.0,
._M_imag=1.0e+0};>>;

thus z2 is already initialized from a bogus value.  Without -std=c++0x we have

  struct complex z2;
  <<cleanup_point <<< Unknown tree: expr_stmt
  std::complex<double>::complex (&z2, -0.0, 1.0e+0) >>>>>;

which is correct.


  reply	other threads:[~2011-11-02  9:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-02  8:24 [Bug libstdc++/50957] New: " kreckel at ginac dot de
2011-11-02  9:37 ` rguenth at gcc dot gnu.org [this message]
2011-11-02  9:40 ` [Bug c++/50957] [C++0x][constexpr] " paolo.carlini at oracle dot com

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=bug-50957-4-mIym08VwB5@http.gcc.gnu.org/bugzilla/ \
    --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).