From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19898 invoked by alias); 12 May 2003 18:57:18 -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 17269 invoked from network); 12 May 2003 18:45:52 -0000 Received: from unknown (HELO touchme.toronto.redhat.com) (207.219.125.105) by sources.redhat.com with SMTP; 12 May 2003 18:45:52 -0000 Received: from localhost.localdomain (tooth.toronto.redhat.com [172.16.14.29]) by touchme.toronto.redhat.com (Postfix) with ESMTP id D2A23800030; Mon, 12 May 2003 14:45:51 -0400 (EDT) Subject: Re: [tree-ssa] Out of SSA status and issues From: Andrew MacLeod To: Andrew MacLeod Cc: gcc mailing list In-Reply-To: <1052750563.2730.317.camel@p4> References: <1052750563.2730.317.camel@p4> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Mon, 12 May 2003 18:57:00 -0000 Message-Id: <1052765152.3372.28.camel@p4> Mime-Version: 1.0 X-SW-Source: 2003-05/txt/msg01209.txt.bz2 On Mon, 2003-05-12 at 10:42, Andrew MacLeod wrote: > > The second case occurs when a derefernce is copy propagated into a PHI > node: > > if (T.1_5 != 0B) > { > > # VUSE <(*map)_3>; > # VUSE ; > T.2_8 = map->compact_to_partition; > i.3_9 = (unsigned int)i_6; > T.4_10 = i.3_9 * 4; > T.5_11 = (int *)T.4_10; > > # (*T.6)_13 = VDEF <(*T.6)_7>; > T.6_12 = T.2_8 + T.5_11; > > # VUSE ; > i_14 = (*T.6)_13 > }; > # i_1 = PHI ; > # (*T.6)_2 = PHI <(*T.6)_7(0), (*T.6)_13(1)>; > > # (*T.7)_17 = VDEF <(*T.7)_16>; > # VUSE <(*map)_3>; > # VUSE ; > > The value of i_14 has been propagated into the PHI node. DCE the deletes > the stmt > i_14 = (*T.6)_13 > > When we go to rewrite this, all we know is that its a derefernce of T.6. > There is no VUSE now to look at to figure out what the correct pointer > it. The original def has it as T.6_12. The information could be found > by looking for the def of (*T.6)_13 (which is virtual), and looking at > the real def, which is T.6_12. I am about to try that in my hack and see > if it works. > Actually, is propagating this copy a safe thing to do? Copy propagation simply looks at the def, and if the stmt is a copy, copies it... So if there was a store after the definition of i_14 which killed the memory location that T.6_12 points to, then the PHI is going to get the wrong result... isn't it? ie it would look something like this hacked up example: # (*T.6)_13 = VDEF <(*T.6)_7>; T.6_12 = T.2_8 + T.5_11; # VUSE ; i_14 = (*T.6)_13 # (*T.6)_22 = VDEF <(*T.6)_13> # VUSE *T.6 = 30; }; # i_1 = PHI ; Or is there a reason that copyprop would never happen? Should we never copyprop an indirect reference? Andrew