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]

Re: [patches] Re: infinite loop in SPEC's gcc after your patches


> On Mon, Jul 23, 2001 at 05:27:24PM +0200, Jan Hubicka wrote:
> > !   if (cbranch_dest_block->index != jump_block->index + 1)
> >       return false;
> >   
> >     /* Invert the conditional branch.  Prevent jump.c from deleting
> > --- 3056,3063 ----
> >     /* The conditional branch must target the block after the
> >        unconditional branch.  */
> >     cbranch_dest_block = cbranch_jump_edge->dest;
> > ! 
> > !   if (!can_fallthru (jump_block, cbranch_dest_block))
> >       return false;
> 
> Um.. we're never supposed to be able to fallthru here.
> You've disabled this whole pass.
It still works - the jump_block is block we are going to remove
and cbranch_dest_block is the destination of cbranch after the jump_block.

All the can_fallthrdu does as extra compared to the index test above is
to verify, that there is no jump table lurking around.
> 
> >     flow_delete_block (jump_block);
> > +   /* Selectively unlink the sequence.  */
> > +   if (cbranch_jump_edge->src->end != PREV_INSN (cbranch_jump_edge->dest->head))
> > +     flow_delete_insn_chain (NEXT_INSN (cbranch_jump_edge->src->end),
> > + 			    PREV_INSN (cbranch_jump_edge->dest->head));
> 
> This would be fine if you used the variables that already 
> contain cbranch_jump_edge->src and cbranch_jump_edge->dest.
Because the code above changed the destination of edges, I expected to 
be easier to read if I use values in the edge to make it more self
contained.

I am just testing following patch. Do you preffer it instead of
this solution?

Mon Jul 23 22:56:44 CEST 2001  Jan Hubicka <jh@suse.cz>
	* flow.c (try_simplify_condjump): Use variables holding the edge
	destinations instead of getting it directly.

Index: flow.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/flow.c,v
retrieving revision 1.436
diff -c -3 -p -r1.436 flow.c
*** flow.c	2001/07/23 15:27:33	1.436
--- flow.c	2001/07/23 20:56:07
*************** try_simplify_condjump (cbranch_block)
*** 3081,3089 ****
    
    flow_delete_block (jump_block);
    /* Selectively unlink the sequence.  */
!   if (cbranch_jump_edge->src->end != PREV_INSN (cbranch_jump_edge->dest->head))
!     flow_delete_insn_chain (NEXT_INSN (cbranch_jump_edge->src->end),
! 			    PREV_INSN (cbranch_jump_edge->dest->head));
    return true;
  }
  
--- 3081,3089 ----
    
    flow_delete_block (jump_block);
    /* Selectively unlink the sequence.  */
!   if (cbranch_block->end != PREV_INSN (cbranch_dest_block->head))
!     flow_delete_insn_chain (NEXT_INSN (cbranch_block->end),
! 			    PREV_INSN (cbranch_dest_block->head));
    return true;
  }
  
> 
> 
> r~


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