From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106034 invoked by alias); 23 Aug 2015 12:27:22 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 105977 invoked by uid 48); 23 Aug 2015 12:27:17 -0000 From: "torvald at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/67281] HTM builtins aren't treated as compiler barriers on powerpc Date: Sun, 23 Aug 2015 12:27:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: torvald at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-08/txt/msg01581.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67281 torvald at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |torvald at gcc dot gnu.org --- Comment #6 from torvald at gcc dot gnu.org --- I think tbegin needs to have same semantics as a lock acquisition and the compiler must not assume to know anything about tbegin's return value; tend must have same semantics as a lock release. See the libc-alpha discussion for why I think this is the case: https://sourceware.org/ml/libc-alpha/2015-08/msg00963.html Thus, I don't think a full compiler barrier is necessary, but if we don't have something finer-grained to capture the semantics of a lock acquisition, then we need the compiler barrier (GCC currently assumes atomics to be compiler barriers AFAIK). We should in any case agree on a semantics and document it in the GCC sources. Documenting that we need a full compiler barrier is not correct in that it's not a necessary condition (even though it should be a sufficient condition).