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: [3.4] fixup_reorder_chain fix


> > this is patch I am testing to fix the bug.
> 
> Thanks.
> 
> > Since this code is so rarely excercised I would welcome if you run the Ada 
> > testsuite on it. 
> 
> Yes, I'll give it a whirl.
> 
> > To summarize some of offlist discussion.  The actual problem is
> > -fnon-call-exception (enabled by default by Ada) preventing GCC from
> > removing the conditional branch to next instruction.  THis results in
> > fallthru and branch edge to be indentified excercising interesting side
> > corners of cfglayout code previously used only by HP-PA.
> 
> In other words, there is only one normal edge, which is FALLTHRU, although the 
> basic block ends with a conditional jump.
> 
> > The orignal hack created duplicated edge that resulted in CFG breaking
> > our invariants and since we added more sanity checking, it fires now.
> 
> My understanding is that the problem was not the duplicate edge, but the 
> mismatch between the target of the edge and the target of the jump, because 
> the latter has been redirected to itself.

Both was problem, see later.
> 
> > The current workaround is to redirect the branch edge to form self-loop
> > around the current BB and redirect it properly later in function.  I
> > tried this once before in past but it falled into cracks when the
> > conditonal formed infinite self loop, so I went the way of duplicated
> > edges.  Alternate sollution is to create new basic block destination in
> > this very side case that I am doing now.
> 
> Do we really need to work so hard?  Why can't we simply create the duplicate 
> edge and let force_nonfallthru un-duplicate it?  IIUC it will create a new 
> basic block and a new fallthru edge targetting it, so the former duplicated 
> edge and the new fallthru edge will not target the same block anymore.

This is what the former code attempted to do but that leads to ICE too.
The problem is that edge redirection code knows about the fact that the fallthru
edge might be identified with the branch edge and will cowardly refuse to do the
redirection...

Honza
> 
> -- 
> Eric Botcazou



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