public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Steve Kargl <sgk@troutmask.apl.washington.edu>
To: Steve Kargl via Fortran <fortran@gcc.gnu.org>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Fortran: fix compile-time simplification of SET_EXPONENT [PR109511]
Date: Fri, 14 Apr 2023 12:48:00 -0700	[thread overview]
Message-ID: <ZDmt8KatA/BlxDnW@troutmask.apl.washington.edu> (raw)
In-Reply-To: <ZDmqfsg+jIOOGqKY@troutmask.apl.washington.edu>

On Fri, Apr 14, 2023 at 12:33:18PM -0700, Steve Kargl via Fortran wrote:
> 
>    If X is an IEEE NaN, the result is the same NaN.
> 

A better testcase as gfortran will quiet a NaN on assignment.

program foo
   integer i
   equivalence(i,y)
   i = int(z'7FC0BEEF',4)  ! Add payload to NaN.
   print '(F4.0,2(1X,Z8.8))', y, y, set_exponent(y,1)
end program foo

gfortran -o z a.f90 && ./z
N 7FC0BEEF 7FC00000


-- 
Steve

  reply	other threads:[~2023-04-14 19:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-14 18:59 Harald Anlauf
2023-04-14 19:33 ` Steve Kargl
2023-04-14 19:48   ` Steve Kargl [this message]
2023-04-14 19:49   ` Harald Anlauf
2023-04-14 21:19     ` Steve Kargl
2023-04-17 19:41 ` Bernhard Reutner-Fischer

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=ZDmt8KatA/BlxDnW@troutmask.apl.washington.edu \
    --to=sgk@troutmask.apl.washington.edu \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@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).