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

            Bug ID: 98955
           Summary: Failure to optimize shift+compare to single shift
           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 >> 7;`. This transformation is done by LLVM,
but not by GCC.

Reply via email to