public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/98954] New: Failure to optimize left shift+and pattern
@ 2021-02-03 15:22 gabravier at gmail dot com
  2021-02-28 22:32 ` [Bug tree-optimization/98954] " pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: gabravier at gmail dot com @ 2021-02-03 15:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98954
           Summary: Failure to optimize left shift+and pattern
           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(uint8_t m)
{
    return !((m << 1) & 0xFF);
}

This can be optimized to `return !(m & 0x7F);`. This transformation is done by
LLVM, but not by GCC.

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

end of thread, other threads:[~2022-09-10 21:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-03 15:22 [Bug tree-optimization/98954] New: Failure to optimize left shift+and pattern gabravier at gmail dot com
2021-02-28 22:32 ` [Bug tree-optimization/98954] " pinskia at gcc dot gnu.org
2021-02-28 23:32 ` [Bug tree-optimization/98954] ((X << CST0) & CST1) == 0 is not optimized to 0 == (X & (CST1 >> CST0)) pinskia at gcc dot gnu.org
2021-02-28 23:33 ` pinskia at gcc dot gnu.org
2021-12-01  0:54 ` pinskia at gcc dot gnu.org
2021-12-01  5:49 ` pinskia at gcc dot gnu.org
2022-08-09 17:57 ` cvs-commit at gcc dot gnu.org
2022-08-15 16:41 ` cvs-commit at gcc dot gnu.org
2022-09-10 21:19 ` roger at nextmovesoftware dot com

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