This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/37823] Missed optimization - ffs() from strings.h



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]