[Bug other/32994] New: redundant +/- 1 after __builtin_ffs() inlining.
pluto at agmk dot net
gcc-bugzilla@gcc.gnu.org
Sun Aug 5 09:56:00 GMT 2007
$ cat ffs.c
int idx( unsigned mask )
{
return __builtin_ffs( mask ) - 1;
}
gcc-4.3.0-20070712:
idx: bsfl %edi, %eax
movl $-1, %edx
cmove %edx, %eax
ret
gcc-4.2.2-20070802 produces worse code:
idx: bsfl %edi, %edi
movl $-1, %eax
cmove %eax, %edi
addl $1, %edi
leal -1(%rdi), %eax
ret
--
Summary: redundant +/- 1 after __builtin_ffs() inlining.
Product: gcc
Version: 4.2.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: other
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pluto at agmk dot net
GCC target triplet: x86_64-gnu-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32994
More information about the Gcc-bugs
mailing list