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]

flow.c patch


I've applied the following patch to fix a problem with split_edge when
we insert on an edge to the exit node which is a fall-through edge.

Approved by rth and bootstrapped on solaris.

Andrew

	* flow.c (split_edge): Handle insertion on a fallthrough edge which
	has the EXIT_BLOCK as a dest.

Index: flow.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/flow.c,v
retrieving revision 1.189
diff -c -p -r1.189 flow.c
*** flow.c	1999/09/07 04:13:45	1.189
--- flow.c	1999/09/09 19:25:47
*************** split_edge (edge_in)
*** 1154,1160 ****
    basic_block old_pred, bb, old_succ;
    edge edge_out;
    rtx bb_note;
!   int i;
   
    /* Abnormal edges cannot be split.  */
    if ((edge_in->flags & EDGE_ABNORMAL) != 0)
--- 1154,1160 ----
    basic_block old_pred, bb, old_succ;
    edge edge_out;
    rtx bb_note;
!   int i, j;
   
    /* Abnormal edges cannot be split.  */
    if ((edge_in->flags & EDGE_ABNORMAL) != 0)
*************** split_edge (edge_in)
*** 1264,1270 ****
  
    /* Place the new block just in front of the successor.  */
    VARRAY_GROW (basic_block_info, ++n_basic_blocks);
!   for (i = n_basic_blocks - 1; i > old_succ->index; --i)
      {
        basic_block tmp = BASIC_BLOCK (i - 1);
        BASIC_BLOCK (i) = tmp;
--- 1264,1274 ----
  
    /* Place the new block just in front of the successor.  */
    VARRAY_GROW (basic_block_info, ++n_basic_blocks);
!   if (old_succ == EXIT_BLOCK_PTR)
!     j = n_basic_blocks - 1;
!   else
!     j = old_succ->index;
!   for (i = n_basic_blocks - 1; i > j; --i)
      {
        basic_block tmp = BASIC_BLOCK (i - 1);
        BASIC_BLOCK (i) = tmp;
*************** split_edge (edge_in)
*** 1274,1280 ****
    bb->index = i;
  
    /* Create the basic block note.  */
!   bb_note = emit_note_before (NOTE_INSN_BASIC_BLOCK, old_succ->head);
    NOTE_BASIC_BLOCK (bb_note) = bb;
    bb->head = bb->end = bb_note;
  
--- 1278,1287 ----
    bb->index = i;
  
    /* Create the basic block note.  */
!   if (old_succ != EXIT_BLOCK_PTR)
!     bb_note = emit_note_before (NOTE_INSN_BASIC_BLOCK, old_succ->head);
!   else
!     bb_note = emit_note_after (NOTE_INSN_BASIC_BLOCK, get_last_insn ());
    NOTE_BASIC_BLOCK (bb_note) = bb;
    bb->head = bb->end = bb_note;
  


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