From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20774 invoked by alias); 3 Feb 2014 11:49:53 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 20762 invoked by uid 89); 3 Feb 2014 11:49:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail-gw1-out.broadcom.com Received: from mail-gw1-out.broadcom.com (HELO mail-gw1-out.broadcom.com) (216.31.210.62) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 03 Feb 2014 11:49:51 +0000 Received: from irvexchcas08.broadcom.com (HELO IRVEXCHCAS08.corp.ad.broadcom.com) ([10.9.208.57]) by mail-gw1-out.broadcom.com with ESMTP; 03 Feb 2014 04:15:12 -0800 Received: from SJEXCHCAS07.corp.ad.broadcom.com (10.16.203.16) by IRVEXCHCAS08.corp.ad.broadcom.com (10.9.208.57) with Microsoft SMTP Server (TLS) id 14.3.174.1; Mon, 3 Feb 2014 03:49:50 -0800 Received: from SJEXCHMB13.corp.ad.broadcom.com ([fe80::9d40:1e86:a7dc:c46a]) by SJEXCHCAS07.corp.ad.broadcom.com ([::1]) with mapi id 14.03.0174.001; Mon, 3 Feb 2014 03:49:50 -0800 From: Bingfeng Mei To: Richard Biener , Florian Weimer CC: Jakub Jelinek , "gcc@gcc.gnu.org" Subject: RE: No TBAA before ptr_derefs_may_alias_p? Date: Mon, 03 Feb 2014 11:49:00 -0000 Message-ID: References: <52EBC010.5030409@suse.de> <783352a3-eb4d-467a-82bd-8cca90f74a30@email.android.com> <20140203095938.GF892@tucnak.redhat.com> <52EF6C00.2030300@redhat.com> In-Reply-To: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00018.txt.bz2 For the following code, why can load be moved before store instruction? TBA= A still applies even it is an anti-dependency. Somehow alias analysis is im= plemented differently in vectorization.=20 for=20 int foo (long long *a, short *b, int n) { *a =3D (long long)(n * 100); =20=20 return (*b) + 1000; } x86-64 code imull $100, %edx, %edx movswl (%rsi), %eax movslq %edx, %rdx movq %rdx, (%rdi) addl $1000, %eax ret Bingfeng -----Original Message----- From: Richard Biener [mailto:rguenther@suse.de]=20 Sent: 03 February 2014 10:18 To: Florian Weimer Cc: Jakub Jelinek; Bingfeng Mei; gcc@gcc.gnu.org Subject: Re: No TBAA before ptr_derefs_may_alias_p? On Mon, 3 Feb 2014, Florian Weimer wrote: > On 02/03/2014 10:59 AM, Jakub Jelinek wrote: > > On Mon, Feb 03, 2014 at 09:51:01AM +0000, Bingfeng Mei wrote: > > > If it is just for C++ placement new, why don't implement it as a > > > lang_hook. > > > Now other languages such as C have to be made conservative and produce > > > worse > > > code. > >=20 > > Even in C++ code you don't use placement new that often, so e.g. by hav= ing > > the placement new explicit through some special GIMPLE statement in the= IL, > > you could e.g. just look if a particular function or loop contains any > > placement new stmts (cached in struct function and loop?) and use TBAA = if > > it isn't there. >=20 > I believe the convenience of TBAA lies in the fact that you don't have to > prove anything about actual program behavior if the types are sufficiently > distinct. If you allow local violations of that principle, the global > property inevitably breaks down as well. >=20 > In any case, C code can call C++ code and vice versa, so it's difficult to > consider each language in isolation. As I said in other mail even C code can change the dynamic type of a storage location (via memcpy). And as soon as you require a look at stmts inbetween two refs that you ask the oracle to disambiguate you are doing sth wrong. Richard.