From: Steve Kargl <sgk@troutmask.apl.washington.edu>
To: Harald Anlauf via Fortran <fortran@gcc.gnu.org>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Fortran: fix corner case of IBITS intrinsic [PR108937]
Date: Mon, 27 Feb 2023 13:23:26 -0800 [thread overview]
Message-ID: <Y/0fTlIZrLf2p7hF@troutmask.apl.washington.edu> (raw)
In-Reply-To: <trinity-372da1da-70c8-453d-881b-e0f4a0ec0704-1677531278062@3c-app-gmx-bap31>
On Mon, Feb 27, 2023 at 09:54:38PM +0100, Harald Anlauf via Fortran wrote:
>
> as found by the reporter, the result of the intrinsic IBITS
> differed from other compilers (e.g. Intel, NAG) for the corner
> case that the LEN argument was equal to BIT_SIZE(I), which is
> explicitly allowed by the standard.
>
> We actually had an inconsistency for this case between
> code generated by the frontend and compile-time simplified
> expressions.
>
> The reporter noticed that this is related to a restriction in
> gcc that requires that shift widths shall be smaller than the
> bit sizes, and we already special case this for ISHFT.
> It makes sense to use the same special casing for IBITS.
>
> Attached patch fixes this and regtests on x86_64-pc-linux-gnu.
>
> OK for mainline?
Yes. Good catch on comparison with simplification,
which I failed to consider last night.
> This issue has been there for ages. Shall this be backported
> or left in release branches as is?
As always, backporting is up to you and your bandwidth.
Bring the the run-time result and simplification into
agreement suggests that a back port is a good thing.
--
Steve
prev parent reply other threads:[~2023-02-27 21:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-27 20:54 Harald Anlauf
2023-02-27 21:23 ` Steve Kargl [this message]
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=Y/0fTlIZrLf2p7hF@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).