From patchwork Mon Apr 1 00:00:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerald Pfeifer X-Patchwork-Id: 232654 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 4B13F2C00F6 for ; Mon, 1 Apr 2013 11:00:49 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=vu9QMF1qhQDW8DRpO091eOd3GzdGV7gCwse+ezFW/RaVjsvgSR kINJG++dh6VscKVJZLtyqXuTv1/ixVtwSFM6CZUjig5E1k7l4yDp9Ffo+FOh/1Uj 0rGtRbauL3qhWYxLwGLJmL2/jzOJcT0r1GEAB8/R8/YUH0NExpDP39trw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=LpHrGRD6Vx5wSuBveZEH/kDgeWQ=; b=T2AXW8zdqlULDwm+RvJp xJdBTv19UfVvWDLvvKLnT9FcgycjwhcOfzvbCY2RAO1zwPDWtgmrJEjn/jWoVaae FYdT/+CrWXynzWthaobiYSS+TQ9zw1vMO2gF88LMoxloNI3zvT/q1WXEsRcRoiYH 2yCtlMKDrxA/HbXunyf1dr0= Received: (qmail 23548 invoked by alias); 1 Apr 2013 00:00:39 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 23323 invoked by uid 89); 1 Apr 2013 00:00:26 -0000 X-Spam-SWARE-Status: No, score=-50.9 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.1 Received: from ainaz.pair.com (HELO ainaz.pair.com) (209.68.2.66) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 01 Apr 2013 00:00:23 +0000 Received: from [192.168.0.131] (vie-188-118-252-015.dsl.sil.at [188.118.252.15]) by ainaz.pair.com (Postfix) with ESMTPSA id 2DB973F410; Sun, 31 Mar 2013 20:00:21 -0400 (EDT) Date: Mon, 1 Apr 2013 02:00:19 +0200 (CEST) From: Gerald Pfeifer To: gcc-patches@gcc.gnu.org cc: Andi Kleen Subject: [libitm,PATCH] Fix bootstrap due to __always_inline in libitm Message-ID: MIME-Version: 1.0 Andi's patch broke bootstrap on all FreeBSD platforms, which took me a bit to realize since he did not update the ChangeLog: 2013-03-23 Andi Kleen * local_atomic (__always_inline): Add. (__calculate_memory_order, atomic_thread_fence, atomic_signal_fence, test_and_set, clear, store, load, exchange, compare_exchange_weak, compare_exchange_strong, fetch_add, fetch_sub, fetch_and, fetch_or, fetch_xor): Add __always_inline to force inlining. The problem is the he added the following to local_atomic #ifndef __always_inline #define __always_inline inline __attribute__((always_inline)) #endif whereas /usr/include/sys/cdefs.h on FreeBSD has the following #define __always_inline __attribute__((__always_inline__)) and hence misses the inline (plus libitm/common.h already has ALWAYS_INLINE for that purpose). I am fixing this by adding an explicit inline to those cases where necessary. I did not add it to struct members, which are considered inline by default (and believe Andi's patch may have been a bit over- eager from that perspective). Bootstrapped and regression tested on i386-unknown-freebsd10.0. Okay? Gerald 2013-03-31 Gerald Pfeifer PR bootstrap/56714 * local_atomic (__calculate_memory_order): Mark inline. (atomic_thread_fence): Ditto. (atomic_signal_fence): Ditto. (atomic_bool::atomic_flag_test_and_set_explicit): Ditto. (atomic_bool::atomic_flag_clear_explicit): Ditto. (atomic_bool::atomic_flag_test_and_set): Ditto. (atomic_bool::atomic_flag_clear): Ditto. Index: local_atomic =================================================================== --- local_atomic (revision 197262) +++ local_atomic (working copy) @@ -75,7 +75,7 @@ memory_order_seq_cst } memory_order; - __always_inline memory_order + inline __always_inline memory_order __calculate_memory_order(memory_order __m) noexcept { const bool __cond1 = __m == memory_order_release; @@ -85,13 +85,13 @@ return __mo2; } - __always_inline void + inline __always_inline void atomic_thread_fence(memory_order __m) noexcept { __atomic_thread_fence (__m); } - __always_inline void + inline __always_inline void atomic_signal_fence(memory_order __m) noexcept { __atomic_thread_fence (__m); @@ -1545,38 +1545,38 @@ // Function definitions, atomic_flag operations. - __always_inline bool + inline __always_inline bool atomic_flag_test_and_set_explicit(atomic_flag* __a, memory_order __m) noexcept { return __a->test_and_set(__m); } - __always_inline bool + inline __always_inline bool atomic_flag_test_and_set_explicit(volatile atomic_flag* __a, memory_order __m) noexcept { return __a->test_and_set(__m); } - __always_inline void + inline __always_inline void atomic_flag_clear_explicit(atomic_flag* __a, memory_order __m) noexcept { __a->clear(__m); } - __always_inline void + inline __always_inline void atomic_flag_clear_explicit(volatile atomic_flag* __a, memory_order __m) noexcept { __a->clear(__m); } - __always_inline bool + inline __always_inline bool atomic_flag_test_and_set(atomic_flag* __a) noexcept { return atomic_flag_test_and_set_explicit(__a, memory_order_seq_cst); } - __always_inline bool + inline __always_inline bool atomic_flag_test_and_set(volatile atomic_flag* __a) noexcept { return atomic_flag_test_and_set_explicit(__a, memory_order_seq_cst); } - __always_inline void + inline __always_inline void atomic_flag_clear(atomic_flag* __a) noexcept { atomic_flag_clear_explicit(__a, memory_order_seq_cst); } - __always_inline void + inline __always_inline void atomic_flag_clear(volatile atomic_flag* __a) noexcept { atomic_flag_clear_explicit(__a, memory_order_seq_cst); }