[Patch] Fix PR41440 bad edge insertion

andrewhutchinson@cox.net andrewhutchinson@cox.net
Thu Oct 1 14:42:00 GMT 2009


When non-conditional RTL pattern is expanded that contains a jump CFG becomes temporarily wrong.  Edge insertion for  edges looks at end of block RTL and if sees a jump it inserts before jump - thinking it is jump needed for edge.

The bug report includes an alternate patch that  guards the edge insertion so that for a single succesor, fall thru edge it does not look for a jump.

Either patch works. The latest was deemed more prefferable.


---- Steven Bosscher <stevenb.gcc@gmail.com> wrote: 
> On Thu, Oct 1, 2009 at 3:44 PM, Michael Matz <matz@suse.de> wrote:
> > Hi,
> >
> > On Thu, 1 Oct 2009, andrewhutchinson@cox.net wrote:
> >
> >> After discussion with Micael Matz, the preferred method is fix the
> >> problem at the point of RTL expansion. A block that ends with a jump
> >> created by RTL expander on an otherwise fallthru edge, is now padded
> >> with mov(r,r) NOP.
> >
> > I can't approve this but (obviously) think this is the right way.  In
> > addition you might want to pad only when something is queued on that edge
> > (edge->r.insns != NULL) to not generate excessive nop moves.  Probably
> > doesn't matter that much, though.
> 
> I don't like this approach at all, for two reasons:
> 
> 1. Garbage rtl generated (a reg and an insn)
> 2. Looks like it papers over a problem (insns inserted in  the wrong place).
> 
> Ciao!
> Steven



More information about the Gcc-patches mailing list