This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/81759] Improve data tracking for _pext_u64 and __builtin_ffsll
- From: "bugzilla at poradnik-webmastera dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 29 Dec 2017 23:08:28 +0000
- Subject: [Bug target/81759] Improve data tracking for _pext_u64 and __builtin_ffsll
- Auto-submitted: auto-generated
- References: <bug-81759-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81759
--- Comment #2 from Daniel Fruzynski <bugzilla@poradnik-webmastera.com> ---
Looks that __builtin_ffs does not check if input value is nonzero at all.
Assembler code for following code also has unnecessary instructions:
[code]
unsigned int test(unsigned int n)
{
if (n == 0)
__builtin_unreachable();
return __builtin_ffs(n) - 1;
}
[/code]