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: Fix noreturn related LTO ICE


On Tue, 1 Jun 2010, Jan Hubicka wrote:

> > > this leads to verify_ssa that in turn calls verify_stmts.
> > > I always found this wasteful since we do explicit TODO_verify_ssa after
> > > passes that affects the IL.  So what about disabling this behaviour
> > > first and then I can do incremental patch?
> > 
> > Is it possible to disable the default verify-ssa just for IPA passes
> > and would that be enough?
> Hi,
> so this is patch I am testing (it passes boostrap/regtesting on x86_64-linux,
> I am waiting for WHOPR bootstrap with the noreturn autodiscovery).
> Will commit it afterwards.
> 
> I did quick glance through the gimple passes and I think we have enough
> of verify ssa TODOs.  

The patch is ok for me.

Thanks,
Richard.

> Honza
> 
> 	* tree-cfg.c (verify_stmt): Do not skip could_throw test.
> 	* passes.c (execute_function_todo): Do not make implicit verify_ssa.
> 	(execute_all_ipa_transforms): Do not play with the states.
> Index: tree-cfg.c
> ===================================================================
> --- tree-cfg.c	(revision 160079)
> +++ tree-cfg.c	(working copy)
> @@ -4003,14 +4003,8 @@
>      {
>        if (!stmt_could_throw_p (stmt))
>  	{
> -	  /* During IPA passes, ipa-pure-const sets nothrow flags on calls
> -	     and they are updated on statements only after fixup_cfg
> -	     is executed at beggining of expansion stage.  */
> -	  if (cgraph_state != CGRAPH_STATE_IPA_SSA)
> -	    {
> -	      error ("statement marked for throw, but doesn%'t");
> -	      goto fail;
> -	    }
> +	  error ("statement marked for throw, but doesn%'t");
> +	  goto fail;
>  	}
>        else if (lp_nr > 0 && !last_in_block && stmt_can_throw_internal (stmt))
>  	{
> Index: passes.c
> ===================================================================
> --- passes.c	(revision 160079)
> +++ passes.c	(working copy)
> @@ -1171,8 +1171,6 @@
>  execute_function_todo (void *data)
>  {
>    unsigned int flags = (size_t)data;
> -  if (cfun->curr_properties & PROP_ssa)
> -    flags |= TODO_verify_ssa;
>    flags &= ~cfun->last_verified;
>    if (!flags)
>      return;
> @@ -1495,20 +1493,11 @@
>  void
>  execute_all_ipa_transforms (void)
>  {
> -  enum cgraph_state old_state = cgraph_state;
>    struct cgraph_node *node;
>    if (!cfun)
>      return;
>    node = cgraph_node (current_function_decl);
>  
> -  /* Statement verification skip verification of nothorw when
> -     state is IPA_SSA because we do not modify function bodies
> -     after setting the flag on function.  Instead we leave it
> -     to fixup_cfg to do such a transformation.  We need to temporarily
> -     change the cgraph state so statement verifier before
> -     transform do not fire.  */
> -  cgraph_state = CGRAPH_STATE_IPA_SSA;
> -
>    if (node->ipa_transforms_to_apply)
>      {
>        unsigned int i;
> @@ -1522,7 +1511,6 @@
>        VEC_free (ipa_opt_pass, heap, node->ipa_transforms_to_apply);
>        node->ipa_transforms_to_apply = NULL;
>      }
> -  cgraph_state = old_state;
>  }
>  
>  /* Execute PASS. */
> 
> 

-- 
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 - GF: Markus Rex


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