From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32116 invoked by alias); 13 May 2003 12:50:24 -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 32076 invoked from network); 13 May 2003 12:50:24 -0000 Received: from unknown (HELO touchme.toronto.redhat.com) (207.219.125.105) by sources.redhat.com with SMTP; 13 May 2003 12:50:24 -0000 Received: from localhost.localdomain (tooth.toronto.redhat.com [172.16.14.29]) by touchme.toronto.redhat.com (Postfix) with ESMTP id A5B3B800030; Tue, 13 May 2003 08:50:23 -0400 (EDT) Subject: Re: [tree-ssa] Out of SSA status and issues From: Andrew MacLeod To: Diego Novillo Cc: Michael Matz , gcc mailing list In-Reply-To: <1052829751.27232.220.camel@frodo.toronto.redhat.com> References: <1052829751.27232.220.camel@frodo.toronto.redhat.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Tue, 13 May 2003 12:50:00 -0000 Message-Id: <1052830223.7945.83.camel@p4> Mime-Version: 1.0 X-SW-Source: 2003-05/txt/msg01288.txt.bz2 On Tue, 2003-05-13 at 08:42, Diego Novillo wrote: > On Tue, 2003-05-13 at 05:07, Michael Matz wrote: > > > An indirect reference is not a copy. I don't know if tree-ssa thinks it > > is, but it definitely shouldn't. > > > Why? > > 1. foo() > 2. { > 3. int i, *p; > 4. > 5. p = malloc(); > 6. i = *p; > 7. return i + 9; > 8. } > > I see nothing wrong in replacing 'i + 9' with '*p + 9'. It would > probably not be efficient, but I can't see it being wrong. > > Not that tree-ssa will do anything with this code, the default > type-based aliasing is too conservative, but PTA may disambiguate this. There is nothing wrong with it, as long as you know for sure that *p hasn't changed between 'i = *p' and 'i+9'. Copyprop doesnt look for that. All it does is says 'i = *p', I can replace all occurences of i with *p... Andrew