public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/101955] (signed<<31)>>31 should become -(signed&1)
Date: Wed, 18 Aug 2021 19:22:11 +0000 [thread overview]
Message-ID: <bug-101955-4-nZM6za4ALc@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-101955-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101955
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Andreas Schwab from comment #2)
> If you want to be agressive you can optimize f to return 0.
In the middle-end? No, whether it is well defined or undefined depends heavily
on the C/C++ version.
At least ubsan flags it only with C99..C2X, not in C89 nor any C++ versions for
b 1.
For b -1 flaged in C99..C2X and C++11..C++17. C89, C++98 and C++20..C++23
accept that.
Similarly for b > 1, flagged in C99..C2x and C++11..C++17 only.
next prev parent reply other threads:[~2021-08-18 19:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-18 5:47 [Bug middle-end/101955] New: " pinskia at gcc dot gnu.org
2021-08-18 5:48 ` [Bug middle-end/101955] " pinskia at gcc dot gnu.org
2021-08-18 6:49 ` rguenth at gcc dot gnu.org
2021-08-18 15:51 ` schwab@linux-m68k.org
2021-08-18 17:51 ` pinskia at gcc dot gnu.org
2021-08-18 19:22 ` jakub at gcc dot gnu.org [this message]
2021-11-11 0:21 ` navidrahimi at microsoft dot com
2023-08-04 7:10 ` cvs-commit at gcc dot gnu.org
2023-10-11 7:09 ` cvs-commit at gcc dot gnu.org
2023-10-20 23:08 ` cvs-commit at gcc dot gnu.org
2023-10-30 16:23 ` cvs-commit 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-101955-4-nZM6za4ALc@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).