From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30542 invoked by alias); 8 Sep 2004 20:05:57 -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 30453 invoked from network); 8 Sep 2004 20:05:50 -0000 Received: from unknown (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org with SMTP; 8 Sep 2004 20:05:50 -0000 Received: from camelot.ms.mff.cuni.cz (kampanus.ms.mff.cuni.cz [195.113.18.107]) by nikam.ms.mff.cuni.cz (Postfix) with SMTP id C29AF4DDEB; Wed, 8 Sep 2004 22:05:51 +0200 (CEST) Received: by camelot.ms.mff.cuni.cz (sSMTP sendmail emulation); Wed, 8 Sep 2004 22:05:53 +0200 Date: Wed, 08 Sep 2004 20:05:00 -0000 From: Jan Hubicka To: Diego Novillo Cc: Jan Hubicka , "gcc@gcc.gnu.org" , gcc-patches@gcc.gnu.org Subject: Re: aliasing question Message-ID: <20040908200553.GR22818@kam.mff.cuni.cz> References: <20040907105142.GD28472@kam.mff.cuni.cz> <1094566924.21733.36.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1094566924.21733.36.camel@localhost.localdomain> User-Agent: Mutt/1.3.28i X-SW-Source: 2004-09/txt/msg00387.txt.bz2 > On Tue, 2004-09-07 at 06:51, Jan Hubicka wrote: > > > # V_MUST_DEF ; > > value = T.4862_48; > > > > and alias1 dump: > > > > # value_229 = V_MAY_DEF ; > > value = T.4862_48; > > > > Why the MUST_DEF is getting converted to MAY_DEF in such a obvious case > > for MUST_DEF? > > > Before aliasing, 'value' did not belong to any alias set, but after > aliasing it is. If we didn't do that, suppose that: > > *p, alias tag TMT.1, alias set of TMT.1 = { value } > > 1. p = (cond) ? &value : foo (); > 2. *p = 3; > 3. value = T.4862; > 4. return *p; > > If you put a V_MUST_DEF in statement #3, you will consider '*p = 3' > dead. Perhaps, we could put a V_MUST_DEF if there were more than one > element in TMT.1's alias set. Not sure how much would that buy, but it > may be an interesting experiment. Hi, as discussed on the IRC, this check looks unnecesary after all (ie at least my understanding is that optimizer should not conclude the *p dead just from the fact that all object in the alias set has been mustdeffed because the pointer still can point elsewhere). I've bootstrapped®tested the attached patch and commited it after Diego's approval. Honza 2004-09-08 Jan Hubicka * tree-ssa-operands.c (add_stmt_operand): Use V_MUST_DEF even for variables being alias set. Index: tree-ssa-operands.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/tree-ssa-operands.c,v retrieving revision 2.36 diff -c -3 -p -r2.36 tree-ssa-operands.c *** tree-ssa-operands.c 5 Sep 2004 15:24:15 -0000 2.36 --- tree-ssa-operands.c 7 Sep 2004 15:05:47 -0000 *************** add_stmt_operand (tree *var_p, tree stmt *** 1487,1502 **** /* The variable is not aliased or it is an alias tag. */ if (flags & opf_is_def) { ! if (v_ann->is_alias_tag) ! { ! /* Alias tagged vars get V_MAY_DEF to avoid breaking ! def-def chains with the other variables in their ! alias sets. */ ! if (s_ann) ! s_ann->makes_aliased_stores = 1; ! append_v_may_def (var); ! } ! else if (flags & opf_kill_def) { #if defined ENABLE_CHECKING /* Only regular variables may get a V_MUST_DEF --- 1487,1493 ---- /* The variable is not aliased or it is an alias tag. */ if (flags & opf_is_def) { ! if (flags & opf_kill_def) { #if defined ENABLE_CHECKING /* Only regular variables may get a V_MUST_DEF