From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18456 invoked by alias); 13 Jun 2013 02:55:35 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 18441 invoked by uid 89); 13 Jun 2013 02:55:35 -0000 X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE,RP_MATCHES_RCVD autolearn=ham version=3.3.1 Received: from nm14-vm2.bullet.mail.gq1.yahoo.com (HELO nm14-vm2.bullet.mail.gq1.yahoo.com) (98.136.218.253) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 13 Jun 2013 02:55:34 +0000 Received: from [98.137.12.58] by nm14.bullet.mail.gq1.yahoo.com with NNFMP; 13 Jun 2013 02:55:33 -0000 Received: from [98.136.185.40] by tm3.bullet.mail.gq1.yahoo.com with NNFMP; 13 Jun 2013 02:55:33 -0000 Received: from [127.0.0.1] by smtp101.mail.gq1.yahoo.com with NNFMP; 13 Jun 2013 02:55:33 -0000 X-Yahoo-SMTP: fQw2HLOswBAfNNAqnKVM7sze51rEPzp2JLIy X-Rocket-Received: from [192.168.1.45] (limegreensocks@207.118.20.56 with ) by smtp101.mail.gq1.yahoo.com with SMTP; 12 Jun 2013 19:55:33 -0700 PDT Message-ID: <51B934A1.6090402@yahoo.com> Date: Thu, 13 Jun 2013 02:55:00 -0000 From: dw User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: Ian Lance Taylor CC: "gcc-help@gcc.gnu.org" Subject: Re: Question about __builtin_ia32_mfence and memory barriers References: <51AE7119.5090000@yahoo.com> <51B82E29.5000405@yahoo.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2013-06/txt/msg00085.txt.bz2 > As far as I know, __builtin_ia32_mfence does not generate a barrier. > However, what it does do is appear to be a function call to the main > optimization stages of the compiler. Ok, now that makes sense. I kept thinking that somehow it had to be that the compiler was seeing this as a function, but then I kept discarding that theory because the inline function didn't change anything. I'm going to have to ponder the performance implications of this. For example, it seems possible that asm("pause") could end up generating better code than _mm_pause(). > However, it is still possible for memory loads and stores to move after RTL While it may be possible, I am unable to cause it to happen. Without a solid example or authoritative docs describing _mm_mfence as performing a ReadWriteBarrier (preferably both), I'm hard pressed to think of a credible way to file this in bugzilla. On this mildly unsatisfactory note, I'm going to assume that _mm_?fence will work properly and cross my fingers. If I eventually find this not to be true, I'll head straight to bugzilla. Thanks for the help. dw