public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/94884] New: Failure to recognize that result of or is always superior to operands
@ 2020-04-30 12:52 gabravier at gmail dot com
  2020-04-30 12:53 ` [Bug tree-optimization/94884] " gabravier at gmail dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: gabravier at gmail dot com @ 2020-04-30 12:52 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94884
           Summary: Failure to recognize that result of or is always
                    superior to operands
           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 decide() __attribute((const));

inline unsigned getXOrY(unsigned x, unsigned y)
{
    return decide() ? y : x;
}

bool f(unsigned x, unsigned y)
{
    return (x | y) >= getXOrY(x, y);
}

`f` can be optimized to `return true`. This transformation is done by LLVM, not
by GCC.

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

end of thread, other threads:[~2023-10-27  7:51 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-30 12:52 [Bug tree-optimization/94884] New: Failure to recognize that result of or is always superior to operands gabravier at gmail dot com
2020-04-30 12:53 ` [Bug tree-optimization/94884] " gabravier at gmail dot com
2020-04-30 12:54 ` gabravier at gmail dot com
2020-04-30 12:55 ` rguenth at gcc dot gnu.org
2021-08-03 23:25 ` pinskia at gcc dot gnu.org
2021-08-03 23:25 ` pinskia at gcc dot gnu.org
2021-08-03 23:28 ` pinskia at gcc dot gnu.org
2023-08-23  0:37 ` pinskia at gcc dot gnu.org
2023-10-27  7:50 ` cvs-commit at gcc dot gnu.org
2023-10-27  7:50 ` pinskia at gcc dot gnu.org
2023-10-27  7:51 ` 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).