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 tree-optimization/103281] [10/12/13/14 Regression] Dead Code Elimination Regression at -O3 (trunk vs 11.2.0) Date: Mon, 01 May 2023 23:49:33 +0000 [thread overview] Message-ID: <bug-103281-4-tRtkWOVgEo@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-103281-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103281 --- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Hmm: # RANGE [irange] char [0, 2] NONZERO 0x3 c_9 = (charD.7) b.4_5; _1 = c_9 <= 0; Should _1 be replaced with c_9 == 0 which then can be simplified to b.4_5 == 0 That is PR 28794 I think. And then after that we get: b.4_5 == (unsigned int)(b.4_5 == 0) Which should be optimized down to false though we don't either. unsigned f(unsigned t) { unsigned a = t == 0; return t == a; } The general CST cases (I hope I did these correctly): a == (a == CST) -> CST == 0 -> false CST == 1 -> a == 1 | a == 0 others -> a == 0 a != (a == CST) -> CST == 0: false CST == 1: a != 0 || a != 1 others : a != 0 a != (a != CST) -> CST == 0: a == 1 | a == 0 CST == 1: true others : a != 1 a == (a != CST) -> CST == 0: a == 1 | a == 0 CST == 1: false others : a == 1
next prev parent reply other threads:[~2023-05-01 23:49 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-11-16 18:31 [Bug tree-optimization/103281] New: [12 " theodort at inf dot ethz.ch 2021-11-16 20:51 ` [Bug tree-optimization/103281] [9/12 " pinskia at gcc dot gnu.org 2021-11-16 20:52 ` [Bug tree-optimization/103281] [9/10/12 " pinskia at gcc dot gnu.org 2021-11-16 21:03 ` pinskia at gcc dot gnu.org 2021-11-16 21:16 ` pinskia at gcc dot gnu.org 2021-11-18 10:31 ` marxin at gcc dot gnu.org 2022-01-18 14:28 ` rguenth at gcc dot gnu.org 2022-05-27 9:46 ` [Bug tree-optimization/103281] [10/12/13 " rguenth at gcc dot gnu.org 2022-06-28 10:46 ` jakub at gcc dot gnu.org 2023-05-01 23:49 ` pinskia at gcc dot gnu.org [this message] 2023-08-07 5:47 ` [Bug tree-optimization/103281] [12/13/14 " pinskia at gcc dot gnu.org 2023-08-07 6:34 ` pinskia at gcc dot gnu.org 2023-08-07 6:34 ` pinskia at gcc dot gnu.org 2023-08-08 15:42 ` cvs-commit at gcc dot gnu.org 2023-08-08 15:43 ` pinskia at gcc dot gnu.org 2023-08-08 15:46 ` 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-103281-4-tRtkWOVgEo@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).