From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1041 invoked by alias); 20 Nov 2015 18:57:14 -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 1030 invoked by uid 89); 20 Nov 2015 18:57:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 20 Nov 2015 18:57:12 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 802DB385D23; Fri, 20 Nov 2015 18:57:11 +0000 (UTC) Received: from localhost.localdomain (ovpn-113-91.phx2.redhat.com [10.3.113.91]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tAKIvA1E021269; Fri, 20 Nov 2015 13:57:11 -0500 Subject: Re: Remove noce_mem_write_may_trap_or_fault_p in ifcvt To: Bernd Schmidt , GCC Patches , Jakub Jelinek , Sebastian Pop , Michael Matz References: <563CE17F.6090308@t-online.de> <563CF3F0.8010703@redhat.com> <563CF504.2070604@redhat.com> <563CFD92.7020808@redhat.com> <563CFFC0.6020908@redhat.com> <563D170B.3010800@redhat.com> <564CCE73.1090907@redhat.com> <564D0E7C.9070703@redhat.com> <564F297B.8040603@redhat.com> From: Jeff Law Message-ID: <564F6D06.1010806@redhat.com> Date: Fri, 20 Nov 2015 18:57:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <564F297B.8040603@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg02527.txt.bz2 On 11/20/2015 07:08 AM, Bernd Schmidt wrote: > > BZ27313 is marked as fixed by the introduction of the tree cselim pass, > thus the problem won't even be seen at RTL level. Cool. > I'm undecided on whether cs-elim is safe wrt the store speculation vs > locks concerns raised in the thread discussing Ian's > noce_can_store_speculate_p, but that's not something we have to consider > to solve the problem at hand. I don't think cs-elim is safe WRT locks and such in multi-threaded code. In particular it replaces this: bb0: if (cond) goto bb2; else goto bb1; bb1: *p = RHS; bb2: with bb0: if (cond) goto bb1; else goto bb2; bb1: condtmp' = *p; bb2: condtmp = PHI *p = condtmp; If *p is a shared memory location, then there may be another writer. If that writer happens to store something in that location after the load of *p, but before the store to *p, then that store will get lost in the transformed pseudo code. That seems to introduce a data race. Presumably one would call the original code ill-formed WRT the C11/C++11 memory model since the shared location is not marked as such. I'm willing to consider this an independent problem. > > As far as I can tell hmmer and the 27313 testcase are unaffected at -O2 > (if anything, hmmer was very slightly faster afterwards). The run wasn't > super-scientific, but I wouldn't have expected anything else given the > existence of cs-elim. Cool. It doesn't have to be super-scientific. Good to see it didn't harm anything -- thanks for going the extra mile on this one. > > Ok to do the above, removing all the bits made unnecessary (including > memory_must_be_modified_in_insn_p in alias.c)? Yup. Zap it. jeff