[Bug target/37823] Missed optimization - ffs() from strings.h
ubizjak at gmail dot com
gcc-bugzilla@gcc.gnu.org
Sat Oct 18 18:20:00 GMT 2008
------- Comment #3 from ubizjak at gmail dot com 2008-10-18 18:18 -------
(In reply to comment #2)
> > So the 64bit version is fine, the 32bit version is still funny.
> Default 32bit target doesn't have cmov insn.
> -O3 -m32 -msse produces expected asm:
This is further optimized by the patch at [1], so mainline now generates:
foo:
bsfl 8(%esp), %eax
movl $-1, %edx
cmove %edx, %eax
addl 4(%esp), %eax
ret
(using -fomit-frame-pointer, of course)
[1] http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00777.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37823
More information about the Gcc-bugs
mailing list