public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "joseph at codesourcery dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/48760] [4.6 / 4.7 Regression (?)] std::complex constructor buggy in the face of NaN's
Date: Tue, 26 Apr 2011 14:32:00 -0000 [thread overview]
Message-ID: <bug-48760-4-mDs4IrEEb8@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-48760-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48760
--- Comment #15 from joseph at codesourcery dot com <joseph at codesourcery dot com> 2011-04-26 14:30:50 UTC ---
On Mon, 25 Apr 2011, john at johnmaddock dot co.uk wrote:
> Sorry to be dumb, but doesn't the result of the C code violate section G.5.2 in
> C99 - which is to say that no matter what the value of the imaginary part of an
> expression, it never changes the real part - even if that is a NaN?
I can't make any sense of that sentence - what is the "it" you are saying
is changing a real part but shouldn't be?
In NaN * 1.0fi, the first operand is real and the second is complex (*not*
imaginary, GCC doesn't have imaginary types), so the real part of the
result is NaN*0 which is NaN and the imaginary part is NaN*1 which is also
NaN. Adding 0 then results in a real part of 0+NaN, which is NaN, and an
imaginary part of NaN. This is in accordance with how mixed real/complex
arithmetic works in C99 - implemented for C in 4.5 and I think for C++ in
4.6 (with associated removal of bogus optimizations that tried to treat
values of complex type as being real or imaginary values if one part was
zero).
The built-in function semantics would be those of CMPLXF, CMPLX and CMPLXL
in 7.3.9.3 in the C1X DIS (N1569).
next prev parent reply other threads:[~2011-04-26 14:32 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-25 11:19 [Bug libstdc++/48760] New: " john at johnmaddock dot co.uk
2011-04-25 12:08 ` [Bug middle-end/48760] [4.6 / 4.7 Regression (?)] " paolo.carlini at oracle dot com
2011-04-25 12:42 ` paolo.carlini at oracle dot com
2011-04-25 13:23 ` paolo.carlini at oracle dot com
2011-04-25 16:02 ` joseph at codesourcery dot com
2011-04-25 16:14 ` [Bug libstdc++/48760] " paolo.carlini at oracle dot com
2011-04-25 16:19 ` paolo.carlini at oracle dot com
2011-04-25 16:47 ` paolo.carlini at oracle dot com
2011-04-25 17:22 ` john at johnmaddock dot co.uk
2011-04-25 17:58 ` gdr at gcc dot gnu.org
2011-04-25 18:12 ` paolo.carlini at oracle dot com
2011-04-25 21:41 ` gdr at gcc dot gnu.org
2011-04-25 22:05 ` paolo.carlini at oracle dot com
2011-04-26 8:45 ` rguenth at gcc dot gnu.org
2011-04-26 10:08 ` paolo.carlini at oracle dot com
2011-04-26 14:18 ` gdr at gcc dot gnu.org
2011-04-26 14:32 ` joseph at codesourcery dot com [this message]
2011-04-26 14:56 ` paolo.carlini at oracle dot com
2011-04-26 15:07 ` joseph at codesourcery dot com
2011-04-27 0:04 ` jason at gcc dot gnu.org
2011-04-27 1:31 ` paolo.carlini at oracle dot com
2011-04-27 3:59 ` jason at gcc dot gnu.org
2011-04-27 9:16 ` [Bug libstdc++/48760] [4.6 / 4.7 Regression] " paolo.carlini at oracle dot com
2011-04-27 13:14 ` jason at gcc dot gnu.org
2011-04-27 14:06 ` paolo.carlini at oracle dot com
2011-04-27 21:41 ` paolo.carlini at oracle dot com
2011-04-28 1:54 ` jason at gcc dot gnu.org
2011-04-28 10:53 ` paolo at gcc dot gnu.org
2011-04-28 11:02 ` [Bug libstdc++/48760] [4.6 " paolo.carlini at oracle dot com
2011-04-29 23:24 ` paolo.carlini at oracle dot com
2011-04-29 23:25 ` paolo at gcc dot gnu.org
2011-04-29 23:54 ` gdr at gcc dot gnu.org
2011-04-30 18:19 ` paolo.carlini at oracle dot com
2011-05-02 8:59 ` rguenth at gcc dot gnu.org
2011-11-02 9:44 ` 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-48760-4-mDs4IrEEb8@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).