--- demo.c ---
int ispowerof2(unsigned long long argument) {
return (argument != 0) && ((argument & argument - 1) == 0);
}
--- EOF ---
GCC 12.2gcc -m32 -O3
https://gcc.godbolt.org/z/YWP4zb8jd
ispowerof2(unsigned long long):
pushedi# three registers clob
"Dave Blanchard" wrote:
> Hi Stefan, thanks for sharing this information.
> I was wondering if the code generators in earlier GCC
> versions were any better?
Just open one of the URLs I included, select another GCC version
and see the resulting code.
> Is this a problem in GCC 12+ only?
NO! GC