From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13176 invoked by alias); 1 Aug 2014 09:46:46 -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 13135 invoked by uid 48); 1 Aug 2014 09:46:43 -0000 From: "andysem at mail dot ru" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/53991] _mm_popcnt_u64 fails with -O3 -fgnu-tm Date: Fri, 01 Aug 2014 09:46:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 4.7.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: andysem at mail dot ru X-Bugzilla-Status: NEW 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: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-08/txt/msg00018.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53991 --- Comment #8 from andysem at mail dot ru --- We have a similar problem in Boost.Atomic: https://svn.boost.org/trac/boost/ticket/10204 There we mark all boost::atomic<> functions as always_inline to make sure the compiler sees the memory order arguments as constants as opposed to runtime values (otherwise the compiler just ignores memory order arguments and acts as if seq_cst was specified). As I understand, atomic intrinsics are transaction_unsafe, so should be Boost.Atomic functions as well, yet we still want them always_inline. Given this I don't quite understand the reason why a transaction_unsafe function can't be inlined into the caller; the caller is unsafe anyway, isn't it? Is there a solution for this problem on the source code level, except removing always_inline?