From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16253 invoked by alias); 5 Jul 2010 10:28:26 -0000 Received: (qmail 16245 invoked by uid 22791); 5 Jul 2010 10:28:25 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from nikam-dmz.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 05 Jul 2010 10:28:20 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 6BA509AC806; Mon, 5 Jul 2010 12:28:18 +0200 (CEST) Date: Mon, 05 Jul 2010 10:28:00 -0000 From: Jan Hubicka To: Richard Guenther Cc: Jan Hubicka , gcc-patches@gcc.gnu.org Subject: Re: PR middle-end/44813 (ICE in Mozilla build in ptr_deref_may_alias_decl_p) Message-ID: <20100705102818.GD29130@kam.mff.cuni.cz> References: <20100704224222.GB29130@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2010-07/txt/msg00361.txt.bz2 > > Index: tree-inline.c > > =================================================================== > > --- tree-inline.c (revision 161774) > > +++ tree-inline.c (working copy) > > @@ -1236,7 +1237,11 @@ remap_gimple_stmt (gimple stmt, copy_bod > > If RETVAL is just the result decl, the result decl has > > already been set (e.g. a recent "foo (&result_decl, ...)"); > > just toss the entire GIMPLE_RETURN. */ > > - if (retval && TREE_CODE (retval) != RESULT_DECL) > > + if (retval > > + && (TREE_CODE (retval) != RESULT_DECL > > + && (TREE_CODE (retval) != SSA_NAME > > + || !SSA_NAME_IS_DEFAULT_DEF (retval) > > + || TREE_CODE (SSA_NAME_VAR (retval)) != RESULT_DECL))) > > We should never see a defintion of a RESULT_DECL SSA name for > DECL_BY_REFERENCE RESULT_DECLs (that would > be a bug - we should add verification to the SSA verifier, can you > do add that?). So the || !SSA_NAME_IS_DEFAULT_DEF (retval) can be > dropped here. OK. I just wanted to play safe. > > This patch is ok with that change together with an addition to the > SSA verifier. > > > { > > copy = gimple_build_assign (id->retvar, retval); > > /* id->retvar is already substituted. Skip it on later remapping. */ > > Index: tree-ssa-structalias.c > > =================================================================== > > --- tree-ssa-structalias.c (revision 161774) > > +++ tree-ssa-structalias.c (working copy) > > @@ -5751,7 +5751,8 @@ find_what_p_points_to (tree p) > > /* For parameters, get at the points-to set for the actual parm > > decl. */ > > if (TREE_CODE (p) == SSA_NAME > > - && TREE_CODE (SSA_NAME_VAR (p)) == PARM_DECL > > + && (TREE_CODE (SSA_NAME_VAR (p)) == PARM_DECL > > + || TREE_CODE (SSA_NAME_VAR (p)) == RESULT_DECL) > > && SSA_NAME_IS_DEFAULT_DEF (p)) > > lookup_p = SSA_NAME_VAR (p); > > That doesn't look correct on its own. In fact get_constraint_for_ssa_var > needs a similar adjustment, likewise for consistency (probably doesn't > happen here though) get_fi_for_callee. Will try, thanks! Honza