Date: Fri, 14 Jul 2023 20:57:18 +0000 From: Brooks Davis <brooks@freebsd.org> To: Brooks Davis <brooks@freebsd.org> Cc: Robert Clausecker <fuz@freebsd.org>, 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: <ZLG2rv8/jhz2w2dO@spindle.one-eyed-alien.net> In-Reply-To: <ZLG1KSqm2OeAlY9D@spindle.one-eyed-alien.net> References: <202307142027.36EKRZa8093531@gitrepo.freebsd.org> <ZLG1KSqm2OeAlY9D@spindle.one-eyed-alien.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jul 14, 2023 at 08:50:49PM +0000, Brooks Davis wrote: > On Fri, Jul 14, 2023 at 08:27:35PM +0000, Robert Clausecker wrote: > > The branch main has been updated by fuz: > >=20 > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D3f5788e0ed8e85567f651ad3= 60596b8c330af5a9 > >=20 > > 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 > >=20 > > lib/libc/string/ffs*.c: work around gcc warning > > =20 > > 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. >=20 > Thank you for fixing this. >=20 > 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): >=20 > https://godbolt.org/z/E174v96GT Oops, I missed a case. riscv64 gcc does call ffs so never mind. -- Brooks
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ZLG2rv8/jhz2w2dO>