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 PR89710


On Thu, 14 Mar 2019, Jakub Jelinek wrote:

> On Thu, Mar 14, 2019 at 11:23:03AM +0100, Richard Biener wrote:
> > I am testing the following.  There's IMHO also a missed optimization
> > (for CFG-cleanup?) that when a block does not end up in a call
> > outgoing abnormal edges can be purged?  In this case it is
> > IPA inlining leaving us with this - the inliner calls
> > gimple_purge_dead_abnormal_call_edges on the return block
> > but both cfun->has_nonlocal_label and cfun->calls_setjmp are
> > false so the function does nothing.  This is probably
> > a premature check there?
> 
> I think it would be better to keep the invariant that there are no abnormal
> non-EH edges if both of the cfun bools are false, so that we don't need to
> do useless work in the 99.9% of cases.

I agree.

> In the inliner case, is it that we haven't yet updated those or something
> similar (if yes, could we update them earlier)?

It's the edge still being present when DCE recomputes the flag.

> In the DCE case, can't we when clearing the flag schedule a cleanup and only
> clear it afterwards?

Well, I guess the cleanup would just work iff we'd keep the flag
check in call_can_make_abnormal_goto but remove the flag check
in gimple_purge_dead_abnormal_call_edges.  Not immediately
after DCE but at least inlining gets rid of the edge (and the
abnormal dispatcher) then.

Does that sound reasonable?

Thus like the following, testing in progress.

Richard.

2019-03-14  Richard Biener  <rguenther@suse.de>

	* tree-cfg.c (gimple_purge_dead_abnormal_call_edges): Remove
	premature check.

diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 0dc94ea41d4..69837328279 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -8670,10 +8665,6 @@ gimple_purge_dead_abnormal_call_edges (basic_block bb)
   edge_iterator ei;
   gimple *stmt = last_stmt (bb);
 
-  if (!cfun->has_nonlocal_label
-      && !cfun->calls_setjmp)
-    return false;
-
   if (stmt && stmt_can_make_abnormal_goto (stmt))
     return false;
 


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