public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/109986] New: missing fold (~a | b) ^ a => ~(a & b)
@ 2023-05-26 11:48 vanyacpp at gmail dot com
  2023-05-26 11:57 ` [Bug middle-end/109986] " vanyacpp at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: vanyacpp at gmail dot com @ 2023-05-26 11:48 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109986
           Summary: missing fold (~a | b) ^ a => ~(a & b)
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vanyacpp at gmail dot com
  Target Milestone: ---

int foo(int a, int b)
{
    return (~a | b) ^ a;
}

This can be optimized to `return ~(a | b);`. This transformation is done by
LLVM, but not by GCC.

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

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-26 11:48 [Bug middle-end/109986] New: missing fold (~a | b) ^ a => ~(a & b) vanyacpp at gmail dot com
2023-05-26 11:57 ` [Bug middle-end/109986] " vanyacpp at gmail dot com
2023-05-26 15:12 ` pinskia at gcc dot gnu.org
2023-06-24 22:12 ` vanyacpp at gmail dot com
2023-07-24 15:52 ` cvs-commit at gcc dot gnu.org
2023-07-28  0:13 ` vanyacpp at gmail dot com
2023-08-01 21:50 ` gabravier at gmail dot com
2023-09-17  6:03 ` 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).