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/111910] `a - b < 0` is not transformed into `a < b` for signed types Date: Sat, 21 Oct 2023 21:34:14 +0000 [thread overview] Message-ID: <bug-111910-4-svJLDdCO43@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-111910-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111910 --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- That is: ``` int f(int a, int b) { if (a > b) return a - b; else return b - a; } int fa(int a, int b) { return (a > b) ? (a - b) : (b - a); } int f1(int a, int b) { int t = a - b; if (a > b) return t; else return -t; } int f2(int a, int b) { int t = a - b; if (t > 0) return t; else return -t; } int f3a(int a, int b) { return ((a - b) > 0) ? (a - b) : (b - a); } int f3(int a, int b) { int t = a - b; return t > 0 ? t : -t; } ``` All are detected as ABS<(a-b)> . Right now only f3a and f3 are detected as such.
next prev parent reply other threads:[~2023-10-21 21:34 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-10-21 21:13 [Bug tree-optimization/111910] New: " pinskia at gcc dot gnu.org 2023-10-21 21:24 ` [Bug tree-optimization/111910] " pinskia at gcc dot gnu.org 2023-10-21 21:34 ` pinskia at gcc dot gnu.org [this message] 2023-10-21 21:59 ` pinskia at gcc dot gnu.org 2023-10-22 4:12 ` 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-111910-4-svJLDdCO43@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).