public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/94913] Failure to optimize not+cmp into overflow check Date: Tue, 05 May 2020 20:03:44 +0000 [thread overview] Message-ID: <bug-94913-4-4rTHFcS9qL@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-94913-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94913 --- Comment #2 from Uroš Bizjak <ubizjak at gmail dot com> --- Created attachment 48458 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48458&action=edit Prototype patch Prototype patch for missed optimization, described in Comment #0. Following testcase: --cut here-- int foo (unsigned int x, unsigned int y) { return ~x < y; } void f1 (void); void f2 (void); void bar (unsigned int x, unsigned int y) { if (~x < y) f1 (); else f2 (); } --cut here-- compiles (-O2) to: foo: xorl %eax, %eax addl %esi, %edi setc %al ret bar: addl %esi, %edi jnc .L4 jmp f1 .L4: jmp f2
next prev parent reply other threads:[~2020-05-05 20:03 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-05-02 2:15 [Bug tree-optimization/94913] New: " gabravier at gmail dot com 2020-05-02 2:18 ` [Bug tree-optimization/94913] " gabravier at gmail dot com 2020-05-05 20:03 ` ubizjak at gmail dot com [this message] 2020-05-05 20:06 ` ubizjak at gmail dot com 2020-05-06 13:23 ` jakub at gcc dot gnu.org 2020-05-06 15:35 ` cvs-commit at gcc dot gnu.org 2020-05-08 7:33 ` cvs-commit at gcc dot gnu.org 2020-05-08 7:51 ` jakub 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-94913-4-4rTHFcS9qL@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).