public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/110643] [13/14 Regression] aarch64: Miscompilation at O1 level (O0 is working) Date: Wed, 04 Oct 2023 15:55:34 +0000 [thread overview] Message-ID: <bug-110643-4-4Tg3CyySyu@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-110643-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110643 Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |MOVED Status|WAITING |RESOLVED --- Comment #22 from Andrew Pinski <pinskia at gcc dot gnu.org> --- template <typename T, size_t N, HWY_IF_FLOAT(T)> HWY_API Mask128<T, N> IsInf(const Vec128<T, N> v) { const DFromV<decltype(v)> d; const RebindToSigned<decltype(d)> di; const VFromD<decltype(di)> vi = BitCast(di, v); // 'Shift left' to clear the sign bit, check for exponent=max and mantissa=0. return RebindMask(d, Eq(Add(vi, vi), Set(di, hwy::MaxExponentTimes2<T>()))); } Most likely should have been: ``` template <typename T, size_t N, HWY_IF_FLOAT(T)> HWY_API Mask128<T, N> IsInf(const Vec128<T, N> v) { const DFromV<decltype(v)> d; const RebindToUnsigned<decltype(d)> du; const VFromD<decltype(du)> vi = BitCast(du, v); // 'Shift left' to clear the sign bit, check for exponent=max and mantissa=0. return RebindMask(d, Eq(Add(vi, vi), Set(du, hwy::MaxExponentTimes2<T>()))); } ``` I noticed the bug happens in other places in highway for other targets too (including x86_64). this code is undefined due to an signed integer overflow and that is why using unsigned is needed. Yes -fsanitize=undefined does not currently work for vectors (that is a known limitation).
next prev parent reply other threads:[~2023-10-04 15:55 UTC|newest] Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-07-12 14:10 [Bug target/110643] New: arm64: " malat at debian dot org 2023-07-12 14:11 ` [Bug target/110643] " malat at debian dot org 2023-07-12 16:02 ` pinskia at gcc dot gnu.org 2023-07-12 16:03 ` pinskia at gcc dot gnu.org 2023-07-12 16:06 ` [Bug target/110643] aarch64: " pinskia at gcc dot gnu.org 2023-07-13 6:34 ` malat at debian dot org 2023-07-13 6:35 ` malat at debian dot org 2023-07-13 6:49 ` malat at debian dot org 2023-07-13 8:18 ` [Bug target/110643] [13/14 Regression] " rguenth at gcc dot gnu.org 2023-07-13 8:53 ` malat at debian dot org 2023-07-25 17:00 ` alice at ayaya dot dev 2023-07-27 9:27 ` rguenth at gcc dot gnu.org 2023-09-06 6:29 ` malat at debian dot org 2023-09-29 6:35 ` malat at debian dot org 2023-09-29 6:37 ` malat at debian dot org 2023-09-29 7:22 ` pinskia at gcc dot gnu.org 2023-10-04 12:29 ` malat at debian dot org 2023-10-04 12:33 ` malat at debian dot org 2023-10-04 13:59 ` alice at ayaya dot dev 2023-10-04 15:46 ` pinskia at gcc dot gnu.org 2023-10-04 15:47 ` pinskia at gcc dot gnu.org 2023-10-04 15:48 ` pinskia at gcc dot gnu.org 2023-10-04 15:55 ` pinskia at gcc dot gnu.org [this message] 2023-10-04 16:14 ` pinskia 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-110643-4-4Tg3CyySyu@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).