This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR42805


Hi,

On Mon, Mar 01, 2010 at 04:09:04PM +0100, Richard Guenther wrote:
> On Mon, 1 Mar 2010, Richard Guenther wrote:
> 
> > On Mon, 1 Mar 2010, Jakub Jelinek wrote:
> > 
> > > On Mon, Mar 01, 2010 at 01:16:17PM +0100, Richard Guenther wrote:
> > > > I'm going to bootstrap & test the following patch which addresses
> > > > the issue that SRA ends up introducing new accesses to DECLs with
> > > > DECL_HAS_VALUE_EXPR_P set.
> > > > 
> > > > Martin, does this look ok?  David - can you test this on hppa
> > > > (I verified the testcase no longer ICEs with a cross and the patch).
> > > 
> > > Isn't this a dup of PR41250 that should be fixed by the patch there?
> > 
> > Probably yes, but I'm not sure what is the most safe approach at this 
> > point (though Dave says the patch works for him).  Also the patch
> > probably doesn't preserve debug information - the newly built decl
> > is not linked anywhere.
> 
> I played a bit with the patch from PR41250 and even after some surgery
> I cannot get it to produce proper debug information, even at -O0.
> Thus, I bootstrapped and tested the following variant and verified
> that for the testcase we _do_ now create proper debug information
> (and the callee copy is elided).
> 
> If people that have targets with callee copies want something better
> they have to work to provide it somehow - I can't do more than
> reading the dwarf output we get for hppa.
> 

As far as I am concerned, this is great.  I was also worried about the
impact on debug info of my patch for PR 41250 but never got to really
examining it.

Thanks,

Martin


> Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.
> 
> Richard.
> 
> 2010-03-01  Richard Guenther  <rguenther@suse.de>
> 	Martin Jambor  <mjambor@suse.cz>
> 
> 	PR middle-end/41250
> 	* gimplify.c (gimplify_body): Unset DECL_HAS_VALUE_EXPR_P on
> 	gimplified parameters.
> 
> Index: gcc/gimplify.c
> ===================================================================
> *** gcc/gimplify.c	(revision 157141)
> --- gcc/gimplify.c	(working copy)
> *************** gimplify_body (tree *body_p, tree fndecl
> *** 7535,7545 ****
>     *body_p = NULL_TREE;
>   
>     /* If we had callee-copies statements, insert them at the beginning
> !      of the function.  */
>     if (!gimple_seq_empty_p (parm_stmts))
>       {
>         gimplify_seq_add_seq (&parm_stmts, gimple_bind_body (outer_bind));
>         gimple_bind_set_body (outer_bind, parm_stmts);
>       }
>   
>     if (nonlocal_vlas)
> --- 7535,7555 ----
>     *body_p = NULL_TREE;
>   
>     /* If we had callee-copies statements, insert them at the beginning
> !      of the function and clear DECL_VALUE_EXPR_P on the parameters.  */
>     if (!gimple_seq_empty_p (parm_stmts))
>       {
> +       tree parm;
> + 
>         gimplify_seq_add_seq (&parm_stmts, gimple_bind_body (outer_bind));
>         gimple_bind_set_body (outer_bind, parm_stmts);
> + 
> +       for (parm = DECL_ARGUMENTS (current_function_decl);
> + 	   parm; parm = TREE_CHAIN (parm))
> + 	if (DECL_HAS_VALUE_EXPR_P (parm))
> + 	  {
> + 	    DECL_HAS_VALUE_EXPR_P (parm) = 0;
> + 	    DECL_IGNORED_P (parm) = 0;
> + 	  }
>       }
>   
>     if (nonlocal_vlas)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]