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 #1 from rguenth at gcc dot gnu dot org  2008-10-14 09:31 -------
Trunk produces:

foo:
        pushl   %ebp
        xorl    %eax, %eax
        movl    %esp, %ebp
        bsfl    12(%ebp), %edx
        sete    %al
        negl    %eax
        orl     %eax, %edx
        movl    8(%ebp), %eax
        addl    $1, %edx
        popl    %ebp
        leal    -1(%edx,%eax), %eax
        ret

and

foo:
.LFB0:
        .cfi_startproc
        bsfl    %esi, %eax
        movl    $-1, %edx
        cmove   %edx, %eax
        addl    %edi, %eax
        ret

So the 64bit version is fine, the 32bit version is still funny.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
             Status|UNCONFIRMED                 |NEW
          Component|c                           |target
     Ever Confirmed|0                           |1
   GCC host triplet|x86_64-redhat-linux         |
 GCC target triplet|x86_64-redhat-linux         |i?86-*-*
           Keywords|                            |missed-optimization
   Last reconfirmed|0000-00-00 00:00:00         |2008-10-14 09:31:25
               date|                            |


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]