From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 118928 invoked by alias); 7 Dec 2015 14:09:29 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 118824 invoked by uid 89); 7 Dec 2015 14:09:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 07 Dec 2015 14:09:27 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B381449; Mon, 7 Dec 2015 06:09:03 -0800 (PST) Received: from e108033-lin.cambridge.arm.com (e108033-lin.cambridge.arm.com [10.2.206.36]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4C1F83F21A; Mon, 7 Dec 2015 06:09:24 -0800 (PST) Subject: Re: [Fortran, Patch] Memory sync after coarray image control statements and assignment To: Tobias Burnus , fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org, Alessandro Fanfarillo References: <20151207100645.GA28286@physik.fu-berlin.de> From: Matthew Wahab Message-ID: <56659312.6090700@foss.arm.com> Date: Mon, 07 Dec 2015 14:09:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20151207100645.GA28286@physik.fu-berlin.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-12/txt/msg00741.txt.bz2 On 07/12/15 10:06, Tobias Burnus wrote: > I wrote: >> I wonder whether using >> >> __asm__ __volatile__ ("":::"memory"); >> >> would be sufficient as it has a way lower overhead than >> __sync_synchronize(). > > Namely, something like the attached patch. > > Regarding the original patch submission: Is there a reason that you didn't > include the test case of Deepak from https://gcc.gnu.org/ml/fortran/2015-04/msg00062.html > It should work as -fcoarray=lib -lcaf_single "dg-do run" test. > > Tobias > I don't know anything about Fortran or coarrays and I'm curious whether this affects architectures with weak memory models. Is the barrier only needed to stop reordering by the compiler or is does it also need to stop reordering by the hardware? Matthew