public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "bartoldeman at users dot sourceforge.net" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/107294] Missed optimization: multiplying real with complex number in Fortran (only) Date: Mon, 17 Oct 2022 16:13:17 +0000 [thread overview] Message-ID: <bug-107294-4-PG8t7YUT2o@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-107294-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107294 bartoldeman at users dot sourceforge.net changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #4 from bartoldeman at users dot sourceforge.net --- Thanks for the explanation, finding an example with NaNs you get 0.0 * (NaN + 0.0i) = NaN + 0.0i for C with annex G.5.1 but NaN + NaN i for Fortran, unless you specify -fno-signed-zeros. program main use, intrinsic :: ieee_arithmetic, only: IEEE_Value, IEEE_QUIET_NAN use, intrinsic :: iso_fortran_env, only: real32 real(real32) :: a, nan complex(real32) :: cnan nan = IEEE_VALUE(nan, IEEE_QUIET_NAN) cnan = cmplx(nan, 0.0) zero = 0.0 print *, zero, cnan, zero * cnan end illustrates this 0.00000000 ( NaN, 0.00000000 ) ( NaN, NaN) vs 0.00000000 ( NaN, 0.00000000 ) ( NaN, 0.00000000 )
next prev parent reply other threads:[~2022-10-17 16:13 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-10-17 12:39 [Bug fortran/107294] New: " bartoldeman at users dot sourceforge.net 2022-10-17 12:58 ` [Bug fortran/107294] " rguenth at gcc dot gnu.org 2022-10-17 13:02 ` rguenth at gcc dot gnu.org 2022-10-17 15:14 ` kargl at gcc dot gnu.org 2022-10-17 16:13 ` bartoldeman at users dot sourceforge.net [this message] 2022-10-17 16:14 ` bartoldeman at users dot sourceforge.net 2024-06-17 10:03 ` mjr19 at cam dot ac.uk 2024-06-17 14:38 ` kargls at comcast dot net
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-107294-4-PG8t7YUT2o@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: linkBe 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).