This is the mail archive of the gcc@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]

Re: bug in flow.c



  In message <20000821152153.A776@napalm.go.cz>you write:
  > On Mon, Aug 21, 2000 at 06:20:54AM -0600, Andrew Phillips wrote:
  > > --- flow.c.orig	Mon Jul 31 11:33:28 2000
  > > +++ flow.c	Mon Aug  7 12:22:16 2000
  > > @@ -2530,6 +2530,9 @@
  > >  
  > >    /* Selectively unlink the sequence.  */
  > >    if (q != PREV_INSN (c->head))
  > > +     /* check that we will not orphan b->end 
  > > +      * in the case of NEXT_INSN(b->head) == b->end. */
  > > +      if (b->end == NEXT_INSN(q))  b->end = q;   
  > >      flow_delete_insn_chain (NEXT_INSN (q), PREV_INSN (c->head));
  > >  
  > >    e->flags |= EDGE_FALLTHRU;
  > 
  > Hi,
  > 
  > shouldn't there be parenthness ? I'm not familiar with flow.c, but it seems
  > (according to last CVS) that flow_delete_insn_chain should be executed only
  >  
  > when that first 'if' is in case. So coorected (and updated position against
  > latest CVS) can looks like:
  > 
  > --- flow.c.orig Mon Aug 21 11:18:05 2000
  > +++ flow.c      Mon Aug 21 15:19:07 2000
  > @@ -2559,8 +2559,14 @@
  > 
  >    /* Selectively unlink the sequence.  */
  >    if (q != PREV_INSN (c->head))
  > -    flow_delete_insn_chain (NEXT_INSN (q), PREV_INSN (c->head));
  > -
  > +    {
  > +     /* check that we will not orphan b->end
  > +      * in the case of NEXT_INSN(b->head) == b->end. */
  > +      if (b->end == NEXT_INSN(q))
  > +        b->end = q;
  > +      flow_delete_insn_chain (NEXT_INSN (q), PREV_INSN (c->head));
  > +    }
  > +
  >    e->flags |= EDGE_FALLTHRU;
  >  }
I'd rather see this handled inside the previous hunk of code.

ie, somewhere inside this if block:

 /* Remove what will soon cease being the jump insn from the source block.
     If block B consisted only of this single jump, turn it into a deleted
     note.  */
  q = b->end;
  if (GET_CODE (q) == JUMP_INSN
      && onlyjump_p (q)
      && (any_uncondjump_p (q)
          || (b->succ == e && e->succ_next == NULL)))
    {
    [ ... ]
    }

The reason being I'd like to keep the code which prevents us from
unlinking the insn pointed to by b->end together (you'll see code which
does this inside the if block I pointed out) -- it's just not working for
this particular case.

jeff


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