From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 60017 invoked by alias); 2 Oct 2015 08:00:22 -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 60007 invoked by uid 89); 2 Oct 2015 08:00:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Fri, 02 Oct 2015 08:00:21 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 87F07ABDD; Fri, 2 Oct 2015 08:00:17 +0000 (UTC) Date: Fri, 02 Oct 2015 08:00:00 -0000 From: Richard Biener To: Eric Botcazou cc: Jan Hubicka , gcc-patches@gcc.gnu.org Subject: Re: Do not use TYPE_CANONICAL in useless_type_conversion In-Reply-To: <2765447.zLVJRWqcUa@polaris> Message-ID: References: <20150930211235.GB30640@kam.mff.cuni.cz> <57801859.QRu7TrYMFC@polaris> <20151001174434.GA86704@kam.mff.cuni.cz> <2765447.zLVJRWqcUa@polaris> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2015-10/txt/msg00162.txt.bz2 On Fri, 2 Oct 2015, Eric Botcazou wrote: > > Yep, I was thinking of alignment. I think we are safe here as we are safe > > with any other memory access properties in the references. Those are not > > supposed to be preserved by useless_type_conversions. > > Some explicit type casts need to be preserved on memory accesses, see the > TYPE_ALIGN_OK flag; this is needed for Ada on strict-alignment platforms. I believe TYPE_ALIGN_OK should be "lowered" so that if you have a handled-component chain with some intermediate TYPE_ALIGN_OK you lower it to taking the address of that component and dereferencing it (which is where the middle-end always trusts the alignment of the type of the dereference). I don't think we honor TYPE_ALIGN_OK "ok" everywhere ("ok" in the optimistic sense). Richard.