From nobody Fri Jul 14 20:57:18 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R2kLl0Z5Jz4mp2t; Fri, 14 Jul 2023 20:57:19 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4R2kLl08Jzz3M4N; Fri, 14 Jul 2023 20:57:19 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Authentication-Results: mx1.freebsd.org; none Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 8FBA93C0199; Fri, 14 Jul 2023 20:57:18 +0000 (UTC) Date: Fri, 14 Jul 2023 20:57:18 +0000 From: Brooks Davis To: Brooks Davis Cc: Robert Clausecker , 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: References: <202307142027.36EKRZa8093531@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Rspamd-Queue-Id: 4R2kLl08Jzz3M4N X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N 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 > > AuthorDate: 2023-07-10 22:10:52 +0000 > > Commit: Robert Clausecker > > 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