[Bug tree-optimization/102486] New: __builtin_popcount(y&-y) is not optimized to 1

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Sep 26 08:26:38 GMT 2021


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

            Bug ID: 102486
           Summary: __builtin_popcount(y&-y) is not optimized to 1
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Take:
int f(unsigned y)
{
  return __builtin_popcount(y&-y);
}

This should be optimized to just 1.


More information about the Gcc-bugs mailing list