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

--- Comment #13 from rguenther at suse dot de <rguenther at suse dot de> ---
On Mon, 6 Feb 2023, jakub at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108656
> 
> --- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
> (In reply to rguent...@suse.de from comment #11)
> > On Mon, 6 Feb 2023, jakub at gcc dot gnu.org wrote:
> > 
> > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108656
> > > 
> > > --- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
> > > Anyway, if we decided that it is ok to have just the incoming ab edges, 
> > > we'd
> > > need to change any code that can DCE or inline calls to update abnormal 
> > > edges
> > > not just for the case where the last stmt used to be 
> > > can_make_abnormal_goto and
> > > no longer is, but also for the case when the first stmt was returns_twice 
> > > call
> > > and no longer is, in that case we'd need to drop that abnormal edge 
> > > pointing to
> > > the start of the bb from the .ABNORMAL_DISPATCHER block.
> > 
> > Doesn't cleanup CFG do this via removal of the unreachable 
> > .ABNORMAL_DISPATCHER?
> 
> If all non-pure calls are removed (all can_make_abnormal_goto to be precise),
> sure.  Or if we reset and recompute cfun->calls_setjmp and then do cfg 
> cleanup.
> The problem on the above testcase is that it can never happen or takes many
> passes.
> The returns_twice function is gone during einline pass, but there are other
> calls that can make abnormal goto (well, have side-effects and nothing noticed
> we don't have any returns_twice calls anymore).  So we have an ab edge 
> pointing
> to a bb that doesn't start with returns_twice function, that alone looks wrong
> to me.  During IPA we then inline further functions and diverge on when we
> trigger the removal on outgoing abnormal edges because of debug stmts.

I've fixed a lot of issues like this, even implemented a verifier, but 
that's still too trigger happy.  So yes, there are some issues left
and the only hard assert I've put in is the DCE one that makes sure
abnormal dispatchers are not discovered "late".

Reply via email to