From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10455 invoked by alias); 31 Mar 2011 13:28:07 -0000 Received: (qmail 10443 invoked by uid 22791); 31 Mar 2011 13:28:06 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 31 Mar 2011 13:28:02 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p2VDRto4024168 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 31 Mar 2011 09:27:55 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p2VDRsnR028483; Thu, 31 Mar 2011 09:27:54 -0400 Received: from [10.3.113.84] (ovpn-113-84.phx2.redhat.com [10.3.113.84]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p2VDRq3O030771; Thu, 31 Mar 2011 09:27:53 -0400 Message-ID: <4D948158.1010601@redhat.com> Date: Thu, 31 Mar 2011 13:32:00 -0000 From: Jeff Law User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Lightning/1.0b3pre Thunderbird/3.1.9 MIME-Version: 1.0 To: Richard Guenther CC: Andrew MacLeod , "Joseph S. Myers" , Aldy Hernandez , Richard Henderson , gcc-patches Subject: Re: [cxx-mem-model] disallow load data races (1 of some) References: <4D8B8051.2030307@redhat.com> <4D8BA278.8000300@redhat.com> <4D8BB82F.3060901@redhat.com> <4D8BDA6F.2090304@redhat.com> <4D947CE0.2080909@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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 X-SW-Source: 2011-03/txt/msg02192.txt.bz2 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 03/31/11 07:26, Richard Guenther wrote: > On Thu, Mar 31, 2011 at 3:08 PM, Jeff Law wrote: > On 03/24/11 17:57, Andrew MacLeod wrote: >>>> My fault for not being specific about it... I tend to just use data race >>>> as a catch all for all these types of things when talking about them >>>> with Aldy. >>>> >>>> the testcase should have for (x=0; x< limit; x++) sum[x] = global; >>>> rather than x<5, so that its not a known loop count. >>>> >>>> The hoisted load is then not allowed as it become a speculative load of >>>> 'global' on the main path which would not otherwise have been there. >>>> When the value of limit < 0, this can cause a load race detection on >>>> systems with either a software or hardware data race detector. > We generally don't allow this kind of code motion anyway -- though it's > more because we haven't built any kind of analysis to determine that > this kind of speculative load is often profitable and can't result in a > fault. > > However, having a switch we can throw to avoid this behaviour (assuming > we add this kind of speculative code motion one day) is, IMHO, a good thing. > >> If we know the access to global cannot trap I see no reason to disallow >> speculative reading of it. Without trip count estimates the speculative read can introduce a performance regression. jeff -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJNlIFYAAoJEBRtltQi2kC7+PsH/jRDrhp30ZgRcKctox4/4w46 GBPWsizmDttIg9INfWejX5xvD6wj++qKwBEjD4+5CiDPnjVg6A+5Kr4NrfyQoINx m/kJHmSlO70jHTkfux24tA+Psyj+eyxEFIsXtntaW06MN0J4umEUceJj1SKygi4Q qVfzR9q8gqDKZSEaNzDDpuZh8ANGt2Te4aAK27zd1aWImqjNdXJquESnr0i9Wyqo Q6539rpfemCmSY5dusu0IGUoEWmKqk7EpfJPSsfZgb5E4FgnDMUCclHcNeMQatAC aDmTVeP/AAtd+9ILwVyu0/j38Es6v5kMUXIRJxhMtjLAIQ6DTSajM7IUmuOs4Lg= =TF6O -----END PGP SIGNATURE-----