PR middle-end/44813 (ICE in Mozilla build in ptr_deref_may_alias_decl_p)

Jan Hubicka hubicka@ucw.cz
Mon Jul 5 10:28:00 GMT 2010


> > 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



More information about the Gcc-patches mailing list