Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Jul 2023 20:50:49 +0000
From:      Brooks Davis <brooks@freebsd.org>
To:        Robert Clausecker <fuz@freebsd.org>
Cc:        src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org
Subject:   Re: git: 3f5788e0ed8e - main - lib/libc/string/ffs*.c: work around gcc warning
Message-ID:  <ZLG1KSqm2OeAlY9D@spindle.one-eyed-alien.net>
In-Reply-To: <202307142027.36EKRZa8093531@gitrepo.freebsd.org>
References:  <202307142027.36EKRZa8093531@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jul 14, 2023 at 08:27:35PM +0000, Robert Clausecker wrote:
> The branch main has been updated by fuz:
> 
> URL: https://cgit.FreeBSD.org/src/commit/?id=3f5788e0ed8e85567f651ad360596b8c330af5a9
> 
> commit 3f5788e0ed8e85567f651ad360596b8c330af5a9
> Author:     Robert Clausecker <fuz@FreeBSD.org>
> AuthorDate: 2023-07-10 22:10:52 +0000
> Commit:     Robert Clausecker <fuz@FreeBSD.org>
> CommitDate: 2023-07-14 20:26:43 +0000
> 
>     lib/libc/string/ffs*.c: work around gcc warning
>     
>     Gcc warns of infinite recursion if we use __builtin_ffs*() to
>     implement ffs*().  This is because gcc uses ffs() to implement
>     these on some platforms.  Sidestep the warning by using
>     __builtin_ctz*() for these.

Thank you for fixing this.

The warning seems to be rather bogus and we might be better off
suppressing it as (based on poking at compiler explorer) the warning
doesn't appear to apply to any architecture we care about and quite a few
compilers generate worse code for the __builtin_ctz*() implementations
(including gcc for x86-64 at -O2):

https://godbolt.org/z/E174v96GT

-- Brooks



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ZLG1KSqm2OeAlY9D>