public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "roger at nextmovesoftware dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/25186] (short)(((int)short_var) <<1) should be folded so that the shift is done in the short type Date: Sat, 22 Apr 2023 08:06:50 +0000 [thread overview] Message-ID: <bug-25186-4-iyMgbtmFKd@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-25186-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25186 Roger Sayle <roger at nextmovesoftware dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |13.0 Status|NEW |RESOLVED Resolution|--- |FIXED CC| |roger at nextmovesoftware dot com Known to work| |13.0 --- Comment #10 from Roger Sayle <roger at nextmovesoftware dot com> --- This is now fixed (at the tree level) on mainline (and was fixed in GCC 13). For those wondering, LSHIFT_EXPR is well defined (in this case) in GIMPLE, hence the "optimized" dump currently looks like: void f () { short int * a.0_1; short int _2; short int _3; a.0_1 = a; _2 = *a.0_1; _3 = _2 << 1; *a.0_1 = _3; return; }
next prev parent reply other threads:[~2023-04-22 8:06 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-25186-4@http.gcc.gnu.org/bugzilla/> 2021-09-02 2:03 ` gabravier at gmail dot com 2021-09-02 7:15 ` rguenth at gcc dot gnu.org 2023-04-22 8:06 ` roger at nextmovesoftware dot com [this message] 2005-11-30 18:21 [Bug middle-end/25186] New: (short)(((int)short_var) <<1) should be done in short pinskia at gcc dot gnu dot org 2005-12-01 10:53 ` [Bug middle-end/25186] (short)(((int)short_var) <<1) should be folded so that the shift is done in the short type rguenth at gcc dot gnu dot org 2005-12-01 11:01 ` rguenth at gcc dot gnu dot org 2005-12-01 12:28 ` rguenth at gcc dot gnu dot org 2005-12-01 12:46 ` rguenth at gcc dot gnu dot org 2005-12-01 14:17 ` rguenth at gcc dot gnu dot org 2006-04-05 13:49 ` rguenth at gcc dot gnu dot 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-25186-4-iyMgbtmFKd@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).