public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/96674] New: Failure to optimize combination of comparisons to dec+compare
@ 2020-08-18 10:30 gabravier at gmail dot com
  2020-08-25 10:45 ` [Bug tree-optimization/96674] " rguenth at gcc dot gnu.org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: gabravier at gmail dot com @ 2020-08-18 10:30 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96674
           Summary: Failure to optimize combination of comparisons to
                    dec+compare
           Product: gcc
           Version: 11.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 a, unsigned b)
{
    return (b == 0) | (a < b);
}

This can be optimized to `return a <= (b - 1);`. This transformation is done by
LLVM, but not by GCC.

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

end of thread, other threads:[~2021-09-17  6:44 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-18 10:30 [Bug tree-optimization/96674] New: Failure to optimize combination of comparisons to dec+compare gabravier at gmail dot com
2020-08-25 10:45 ` [Bug tree-optimization/96674] " rguenth at gcc dot gnu.org
2020-08-31  0:58 ` pinskia at gcc dot gnu.org
2021-01-11 22:53 ` erozen at microsoft dot com
2021-01-12 11:52 ` gabravier at gmail dot com
2021-01-12 23:12 ` erozen at microsoft dot com
2021-01-12 23:34 ` gabravier at gmail dot com
2021-01-12 23:45 ` jakub at gcc dot gnu.org
2021-01-14 21:06 ` erozen at microsoft dot com
2021-01-14 21:07 ` erozen at microsoft dot com
2021-01-14 21:30 ` ubizjak at gmail dot com
2021-01-15  0:32 ` erozen at microsoft dot com
2021-01-20 15:32 ` cvs-commit at gcc dot gnu.org
2021-06-02 18:59 ` law at gcc dot gnu.org
2021-09-17  6:44 ` pinskia 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).