From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28297 invoked by alias); 14 May 2003 21:47:35 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 28235 invoked from network); 14 May 2003 21:47:33 -0000 Received: from unknown (HELO crack.them.org) (146.82.138.56) by sources.redhat.com with SMTP; 14 May 2003 21:47:33 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 19G45y-0001CQ-00; Wed, 14 May 2003 16:47:30 -0500 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 19G45U-00059f-00; Wed, 14 May 2003 17:47:00 -0400 Date: Wed, 14 May 2003 21:47:00 -0000 From: Daniel Jacobowitz To: Gabriel Dos Reis Cc: Andreas Schwab , Brad Lucier , gcc@gcc.gnu.org Subject: Re: strict-aliasing and typedefs Message-ID: <20030514214700.GA19731@nevyn.them.org> Mail-Followup-To: Gabriel Dos Reis , Andreas Schwab , Brad Lucier , gcc@gcc.gnu.org References: <200305142056.h4EKujuX025820@banach.math.purdue.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.1i X-SW-Source: 2003-05/txt/msg01459.txt.bz2 On Wed, May 14, 2003 at 11:31:49PM +0200, Gabriel Dos Reis wrote: > Andreas Schwab writes: > > [...] > > | int *sp; > | int *hp; > | > | |> I'm wondering if a Scheme->C compiler > | |> can use typedefs and ISO C's aliasing rules to tell gcc that certain > | |> memory locations cannot alias each other. > | > | One way to do this is to define differently named structures with a single > | member, but they may pessimize the generated code due to ABI > | peculiarities. > > As I understand it, he would like an object-based non-alias > optimization, I believe restrict is a good candidate. That depends. Brad's initial example could also be used for type-based non-alias optimization, for different sets of int objects - which is somewhat looser than restrict allows. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer