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

            Bug ID: 122420
           Summary: `__builtin_clz(~x & (x - 1))` -> `32 -
                    __builtin_ctzg(x, 32)`
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

These 2 functions should produce the same code:
```
int f(int x, int y)
{
  return __builtin_clz(~x & (x - 1));
}

int g(unsigned x, int y)
{
  return 32 - __builtin_ctzg(x, 32);
}
```

Reply via email to