public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/94913] New: Failure to optimize not+cmp into overflow check
@ 2020-05-02  2:15 gabravier at gmail dot com
  2020-05-02  2:18 ` [Bug tree-optimization/94913] " gabravier at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gabravier at gmail dot com @ 2020-05-02  2:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94913

            Bug ID: 94913
           Summary: Failure to optimize not+cmp into overflow check
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gabravier at gmail dot com
  Target Milestone: ---

bool f(unsigned x, unsigned y)
{
    return ~x < y;
}

With -O3, LLVM outputs this :

f(unsigned int, unsigned int):
  add edi, esi
  setb al
  ret

GCC outputs this :

f(unsigned int, unsigned int):
  not edi
  cmp edi, esi
  setb al
  ret

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-05-08  7:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-02  2:15 [Bug tree-optimization/94913] New: Failure to optimize not+cmp into overflow check 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
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

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).