From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27599 invoked by alias); 19 Nov 2001 22:33:13 -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 27562 invoked from network); 19 Nov 2001 22:33:11 -0000 Received: from unknown (HELO gremlin.ics.uci.edu) (128.195.1.70) by sourceware.cygnus.com with SMTP; 19 Nov 2001 22:33:11 -0000 Received: from vino.ics.uci.edu ( vino.ics.uci.edu [128.195.11.198] ) by gremlin-relay.ics.uci.edu id aa12061 ; 19 Nov 2001 14:33 PST To: Richard Kenner Cc: gcc@gcc.gnu.org Subject: Re: should MEM tracking be able to optimize this? References: <10111171935.AA28120@vlsi1.ultra.nyu.edu> From: Dan Nicolaescu In-Reply-To: <10111171935.AA28120@vlsi1.ultra.nyu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 08 Nov 2001 15:28:00 -0000 Message-ID: <200111191433.aa12061@gremlin-relay.ics.uci.edu> X-SW-Source: 2001-11/txt/msg00415.txt.bz2 Richard Kenner writes: Would it be possible to put the fields in different alias sets at tree->rtl conversion time (or whenever the alias sets are first computed), as we should know they don't overlap? Well there's no mechanism for fields to have alias sets and even if they did, the alias set for the reference would be that of "float", not of the field. This is because of the addressing rules in C. OK. How about this example: struct example { char a; int b; char c; int d; } *ex1; void foo (void) { ex1->a = '1'; ex1->b = 2; ex1->c = '3'; ex1->d = 4; } on sparc: foo: !#PROLOGUE# 0 !#PROLOGUE# 1 sethi %hi(ex1), %o1 ld [%o1+%lo(ex1)], %o2 <- this mov 49, %o0 stb %o0, [%o2] ld [%o1+%lo(ex1)], %o3 <- is reloaded after store byte mov 51, %o0 stb %o0, [%o3+8] ld [%o1+%lo(ex1)], %o2 <- same here mov 2, %o0 st %o0, [%o3+4] mov 4, %o1 retl st %o1, [%o2+12] It seems that ex1->a and ex1->c are put in the alias set 0 and it should not be necessary. Can this be avoided?