From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BD1763858D28; Fri, 10 Feb 2023 09:33:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BD1763858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676021619; bh=fYY/Y7aj9XyK94ZVNgmlBWDh8TgjTxvgbMJQwYsQVrQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=xdmWaX0EkMGnU9d+puHfN0ry0PjpAxJp41vByuvzpnlkDbIt0+5Rhn7cJWSFXYtGx OBqFDH0RiGRxRfkEmmsnYvbKDIcwH04PmJw8a3MSsWkn3OQ5DoZWW8Rm9U8kdTPazs /6Oq0o/Q/tJoLMnO2j7CaUq5HJXMLwxkff3Konp4= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/108734] powerpc: False Detection of __atomic_*_8 Builtins Date: Fri, 10 Feb 2023 09:33:37 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108734 --- Comment #7 from Jonathan Wakely --- (In reply to David Edelsohn from comment #5) > __has_builtin() does not mean that the builtin is inlined. It only means > that GCC recognizes the builtin. That is how __has_builtin() is document= ed. > In 32 bit mode, GCC emits an external reference for the builtin: 8 byte > atomic requires libatomic library, which is not linked by default (and > shouldn't be). And this is consistent with e.g. __has_builtin(__builtin_strlen). The fact = that GCC recognizes the token "__builtin_strlen" doesn't mean that you don't nee= d an extern definition of strlen for cases where the built-in isn't inlined. It's just that for the atomic built-ins the name of the built-in is the same as = the name of the extern function that might be used.=