[Bug middle-end/90693] Missing popcount simplifications

david.bolvansky at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri Jun 7 14:09:00 GMT 2019


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

Dávid Bolvanský <david.bolvansky at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |david.bolvansky at gmail dot com

--- Comment #1 from Dávid Bolvanský <david.bolvansky at gmail dot com> ---
>> __builtin_popcount (x) == 1 into x == (x & -x)


This will not work for x = 0.

Should work:
x && x == (x & -x)
x && (x & x-1) == 0


More information about the Gcc-bugs mailing list