https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104356

--- Comment #33 from rguenther at suse dot de <rguenther at suse dot de> ---
On Thu, 3 Feb 2022, jakub at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104356
> 
> --- Comment #29 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
> (In reply to Richard Biener from comment #24)
> > (In reply to Eric Botcazou from comment #22)
> > > > So we'd add
> > > > 
> > > >   (!flag_non_call_exceptions || tree_expr_nonzero_p (@..))
> > > > 
> > > > to the offending and extra listed match.pd transforms.  I guess that 
> > > > works
> > > > for me.
> > > 
> > > For me as well.
> > 
> > Oh, with the little detail that it should be
> > cfun->can_throw_non_call_exceptions
> > (with the unfortunate reference to cfun)
> 
> Why does cfun->can_throw_non_call_exceptions and
> cfun->can_delete_dead_exceptions exist btw?  Now that both
> flag_non_call_exceptions and flag_delete_dead_exceptions are Optimization,
> set_cfun adjusts that on switching the function, so I think it be the same. 
> Ok, {fn,fun,src_cfun}->can_throw_non_call_exceptions might be faster when it
> looks at other functions than opt_for_fn.

I think ->can_throw_non_call_exceptions allows to optimize it based on
IL analysis.  But historically it was because of LTO and before we had
forced the "correct" set of options on all functions.

Btw, !cfun || cfun->... would work as well.

That said, we can probably remove both struct function "copies" of the
flags and replace fun->xxx with OPT_for_fn

Reply via email to