public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "amonakov at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/115161] [15 Regression] highway-1.0.7 miscompilation of some SSE2 intrinsics
Date: Wed, 22 May 2024 08:49:51 +0000	[thread overview]
Message-ID: <bug-115161-4-jc6BXbA44z@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-115161-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115161

--- Comment #20 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #19)
> If we guarantee that we never constant fold FIX/UNSIGNED_FIX with
> -ftrapping-math (we shouldn't, as the exceptions should be raised), then
> using FIX/UNSIGNED_FIX is ok in
> flag_trapping_math guarded patterns even if the intrinsics have some
> specific value they want in those cases, because they will never be folded.

No, this sounds illogical. The compiler may fold out-of-range conversions just
fine, it just needs to preserve the original operation (with its result now
dead), or use any other opportunity to ensure that exceptions are still raised.
Specifically, it is okay to transform

float f;
int i;

f = 0x0.8p+33f;
i = (int) f;

to

f = 0x0.8p+33f;
dummy = (int) f;
i = INT_MAX; // or whatever

The "known" value of 'i' may then facilitate further folding.

  parent reply	other threads:[~2024-05-22  8:49 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-20 10:07 [Bug target/115161] New: " slyfox at gcc dot gnu.org
2024-05-20 11:26 ` [Bug target/115161] " slyfox at gcc dot gnu.org
2024-05-20 14:48 ` roger at nextmovesoftware dot com
2024-05-20 22:08 ` slyfox at gcc dot gnu.org
2024-05-21  6:41 ` rguenth at gcc dot gnu.org
2024-05-21 14:53 ` jakub at gcc dot gnu.org
2024-05-21 15:02 ` jakub at gcc dot gnu.org
2024-05-21 15:13 ` jakub at gcc dot gnu.org
2024-05-21 15:40 ` amonakov at gcc dot gnu.org
2024-05-21 15:50 ` slyfox at gcc dot gnu.org
2024-05-21 15:51 ` jakub at gcc dot gnu.org
2024-05-21 16:07 ` jakub at gcc dot gnu.org
2024-05-22  1:06 ` liuhongt at gcc dot gnu.org
2024-05-22  1:13 ` pinskia at gcc dot gnu.org
2024-05-22  7:27 ` jakub at gcc dot gnu.org
2024-05-22  7:41 ` slyfox at gcc dot gnu.org
2024-05-22  7:43 ` slyfox at gcc dot gnu.org
2024-05-22  7:52 ` liuhongt at gcc dot gnu.org
2024-05-22  8:03 ` jakub at gcc dot gnu.org
2024-05-22  8:22 ` amonakov at gcc dot gnu.org
2024-05-22  8:26 ` jakub at gcc dot gnu.org
2024-05-22  8:49 ` amonakov at gcc dot gnu.org [this message]
2024-05-23 10:39 ` slyfox at gcc dot gnu.org
2024-05-24 22:00 ` slyfox at gcc dot gnu.org
2024-05-25 17:15 ` amonakov at gcc dot gnu.org
2024-05-25 18:44 ` slyfox at gcc dot gnu.org
2024-05-27  0:47 ` [Bug target/115161] highway-1.0.7 miscompilation of _mm_cvttps_epi32(): invalid result assumed liuhongt at gcc dot gnu.org
2024-06-05  4:09 ` cvs-commit at gcc dot gnu.org
2024-06-05  9:13 ` slyfox at gcc dot gnu.org
2024-06-17  8:17 ` cvs-commit at gcc dot gnu.org
2024-07-25  8:08 ` slyfox at gcc dot gnu.org

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-115161-4-jc6BXbA44z@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).