Kill RBI structures

Jan Hubicka jh@suse.cz
Fri Jun 24 18:54:00 GMT 2005


Hi,
this patch merge rbi fields into rtl_bb_info.  This is frees up extra pointer
in basic block structure and is more constent with the overall plan to move to
cfglayout by default.  Also it makes more sense to not reallocate the fields
all the time now when it live in GGC memory.  The savings are quite little
(roughly about 0.7% of overall garbage production, but I think it makes things
bit easier).
I've also replaced the next pointer used to communicate new layout of basic blocks
by aux pointer...

Bootstrapped/regtested i686-pc-gnu-linux.

Honza

2005-06-24  Jan Hubicka  <jh@suse.cz>
	* basic-block.h (basic_block_def): Kill rbi.
	(reorder_block_def): Kill; Remove next field (replaced by aux);
	move other fields to ...
	(rtl_bb_info): ... here.
	* bb-reorder.c (find_traces, rotate_loop, find_traces_1_round,
	copy_bb, connect_traces, add_labels_and_missing_jumps
	fix_up_fall_thru_edges, fix_crossing_conditional_branches,
	duplicate_computed_gotos, partition_hot_cold_basic-blocks):
	Update to new fields.
	* cfg.c (initialize_bb_rbi): Kill.
	* cfglayout.c (record_effective_endpoints, fixup_reorder_chain,
	fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update.
	* cfgrtl.c (cfg_layout_create_basic_block): Do not initialize rbi.
	(try_redirect_by_replacing_jump): Update rbi references.
	(cfg_layout_split_block): Likewise.
	(cfg_layout_delete_block): Likewise.
	(cfg_layout_merge_blocks): Likewise.
	* function.c (thread_prologue_and_epilogue_insns): Likewise.
	* passes.c (rest_of_handle_sms): Likewise.
	* tracer.c (seen, tail_duplicate, layout_superblocks): Likewise.
Index: basic-block.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/basic-block.h,v
retrieving revision 1.265
diff -c -3 -p -r1.265 basic-block.h
*** basic-block.h	16 Jun 2005 10:32:56 -0000	1.265
--- basic-block.h	24 Jun 2005 15:31:27 -0000
*************** struct basic_block_def GTY((chain_next (
*** 233,241 ****
    struct basic_block_def *prev_bb;
    struct basic_block_def *next_bb;
  
-   /* The data used by basic block copying and reordering functions.  */
-   struct reorder_block_def * rbi;
- 
    union basic_block_il_dependent {
        struct rtl_bb_info * GTY ((tag ("1"))) rtl;
      } GTY ((desc ("((%1.flags & BB_RTL) != 0)"))) il;
--- 233,238 ----
*************** struct rtl_bb_info GTY(())
*** 273,297 ****
  
    /* The registers that are live on exit from this block.  */
    bitmap GTY ((skip (""))) global_live_at_end;
- };
- 
- typedef struct basic_block_def *basic_block;
- 
- /* Structure to hold information about the blocks during reordering and
-    copying.  Needs to be put on a diet.  */
  
! struct reorder_block_def GTY(())
! {
    rtx header;
    rtx footer;
  
-   basic_block next;
- 
    /* This field is used by the bb-reorder and tracer passes.  */
    int visited;
  };
  
! typedef struct reorder_block_def *reorder_block_def;
  
  #define BB_FREQ_MAX 10000
  
--- 270,286 ----
  
    /* The registers that are live on exit from this block.  */
    bitmap GTY ((skip (""))) global_live_at_end;
  
!   /* In CFGlayout mode points to insn notes/jumptables to be placed just before
!      and after the block.   */
    rtx header;
    rtx footer;
  
    /* This field is used by the bb-reorder and tracer passes.  */
    int visited;
  };
  
! typedef struct basic_block_def *basic_block;
  
  #define BB_FREQ_MAX 10000
  
*************** extern void reorder_basic_blocks (unsign
*** 940,948 ****
  extern void duplicate_computed_gotos (void);
  extern void partition_hot_cold_basic_blocks (void);
  
- /* In cfg.c */
- extern void initialize_bb_rbi (basic_block bb);
- 
  /* In dominance.c */
  
  enum cdi_direction
--- 929,934 ----
Index: bb-reorder.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/bb-reorder.c,v
retrieving revision 1.106
diff -c -3 -p -r1.106 bb-reorder.c
*** bb-reorder.c	17 Jun 2005 21:42:08 -0000	1.106
--- bb-reorder.c	24 Jun 2005 15:31:27 -0000
*************** find_traces (int *n_traces, struct trace
*** 272,278 ****
  	  basic_block bb;
  	  fprintf (dump_file, "Trace %d (round %d):  ", i + 1,
  		   traces[i].round + 1);
! 	  for (bb = traces[i].first; bb != traces[i].last; bb = bb->rbi->next)
  	    fprintf (dump_file, "%d [%d] ", bb->index, bb->frequency);
  	  fprintf (dump_file, "%d [%d]\n", bb->index, bb->frequency);
  	}
--- 272,278 ----
  	  basic_block bb;
  	  fprintf (dump_file, "Trace %d (round %d):  ", i + 1,
  		   traces[i].round + 1);
! 	  for (bb = traces[i].first; bb != traces[i].last; bb = bb->aux)
  	    fprintf (dump_file, "%d [%d] ", bb->index, bb->frequency);
  	  fprintf (dump_file, "%d [%d]\n", bb->index, bb->frequency);
  	}
*************** rotate_loop (edge back_edge, struct trac
*** 306,319 ****
  
        FOR_EACH_EDGE (e, ei, bb->succs)
  	if (e->dest != EXIT_BLOCK_PTR
! 	    && e->dest->rbi->visited != trace_n
  	    && (e->flags & EDGE_CAN_FALLTHRU)
  	    && !(e->flags & EDGE_COMPLEX))
  	{
  	  if (is_preferred)
  	    {
  	      /* The best edge is preferred.  */
! 	      if (!e->dest->rbi->visited
  		  || bbd[e->dest->index].start_of_trace >= 0)
  		{
  		  /* The current edge E is also preferred.  */
--- 306,319 ----
  
        FOR_EACH_EDGE (e, ei, bb->succs)
  	if (e->dest != EXIT_BLOCK_PTR
! 	    && e->dest->il.rtl->visited != trace_n
  	    && (e->flags & EDGE_CAN_FALLTHRU)
  	    && !(e->flags & EDGE_COMPLEX))
  	{
  	  if (is_preferred)
  	    {
  	      /* The best edge is preferred.  */
! 	      if (!e->dest->il.rtl->visited
  		  || bbd[e->dest->index].start_of_trace >= 0)
  		{
  		  /* The current edge E is also preferred.  */
*************** rotate_loop (edge back_edge, struct trac
*** 329,335 ****
  	    }
  	  else
  	    {
! 	      if (!e->dest->rbi->visited
  		  || bbd[e->dest->index].start_of_trace >= 0)
  		{
  		  /* The current edge E is preferred.  */
--- 329,335 ----
  	    }
  	  else
  	    {
! 	      if (!e->dest->il.rtl->visited
  		  || bbd[e->dest->index].start_of_trace >= 0)
  		{
  		  /* The current edge E is preferred.  */
*************** rotate_loop (edge back_edge, struct trac
*** 352,358 ****
  		}
  	    }
  	}
!       bb = bb->rbi->next;
      }
    while (bb != back_edge->dest);
  
--- 352,358 ----
  		}
  	    }
  	}
!       bb = bb->aux;
      }
    while (bb != back_edge->dest);
  
*************** rotate_loop (edge back_edge, struct trac
*** 362,378 ****
  	 the trace.  */
        if (back_edge->dest == trace->first)
  	{
! 	  trace->first = best_bb->rbi->next;
  	}
        else
  	{
  	  basic_block prev_bb;
  
  	  for (prev_bb = trace->first;
! 	       prev_bb->rbi->next != back_edge->dest;
! 	       prev_bb = prev_bb->rbi->next)
  	    ;
! 	  prev_bb->rbi->next = best_bb->rbi->next;
  
  	  /* Try to get rid of uncond jump to cond jump.  */
  	  if (single_succ_p (prev_bb))
--- 362,378 ----
  	 the trace.  */
        if (back_edge->dest == trace->first)
  	{
! 	  trace->first = best_bb->aux;
  	}
        else
  	{
  	  basic_block prev_bb;
  
  	  for (prev_bb = trace->first;
! 	       prev_bb->aux != back_edge->dest;
! 	       prev_bb = prev_bb->aux)
  	    ;
! 	  prev_bb->aux = best_bb->aux;
  
  	  /* Try to get rid of uncond jump to cond jump.  */
  	  if (single_succ_p (prev_bb))
*************** rotate_loop (edge back_edge, struct trac
*** 393,399 ****
        /* We have not found suitable loop tail so do no rotation.  */
        best_bb = back_edge->src;
      }
!   best_bb->rbi->next = NULL;
    return best_bb;
  }
  
--- 393,399 ----
        /* We have not found suitable loop tail so do no rotation.  */
        best_bb = back_edge->src;
      }
!   best_bb->aux = NULL;
    return best_bb;
  }
  
*************** rotate_loop (edge back_edge, struct trac
*** 402,408 ****
  static void
  mark_bb_visited (basic_block bb, int trace)
  {
!   bb->rbi->visited = trace;
    if (bbd[bb->index].heap)
      {
        fibheap_delete_node (bbd[bb->index].heap, bbd[bb->index].node);
--- 402,408 ----
  static void
  mark_bb_visited (basic_block bb, int trace)
  {
!   bb->il.rtl->visited = trace;
    if (bbd[bb->index].heap)
      {
        fibheap_delete_node (bbd[bb->index].heap, bbd[bb->index].node);
*************** find_traces_1_round (int branch_th, int 
*** 496,503 ****
  	      if (e->dest == EXIT_BLOCK_PTR)
  		continue;
  
! 	      if (e->dest->rbi->visited
! 		  && e->dest->rbi->visited != *n_traces)
  		continue;
  
  	      if (BB_PARTITION (e->dest) != BB_PARTITION (bb))
--- 496,503 ----
  	      if (e->dest == EXIT_BLOCK_PTR)
  		continue;
  
! 	      if (e->dest->il.rtl->visited
! 		  && e->dest->il.rtl->visited != *n_traces)
  		continue;
  
  	      if (BB_PARTITION (e->dest) != BB_PARTITION (bb))
*************** find_traces_1_round (int branch_th, int 
*** 550,556 ****
  	    {
  	      if (e == best_edge
  		  || e->dest == EXIT_BLOCK_PTR
! 		  || e->dest->rbi->visited)
  		continue;
  
  	      key = bb_to_key (e->dest);
--- 550,556 ----
  	    {
  	      if (e == best_edge
  		  || e->dest == EXIT_BLOCK_PTR
! 		  || e->dest->il.rtl->visited)
  		continue;
  
  	      key = bb_to_key (e->dest);
*************** find_traces_1_round (int branch_th, int 
*** 611,617 ****
  
  	  if (best_edge) /* Suitable successor was found.  */
  	    {
! 	      if (best_edge->dest->rbi->visited == *n_traces)
  		{
  		  /* We do nothing with one basic block loops.  */
  		  if (best_edge->dest != bb)
--- 611,617 ----
  
  	  if (best_edge) /* Suitable successor was found.  */
  	    {
! 	      if (best_edge->dest->il.rtl->visited == *n_traces)
  		{
  		  /* We do nothing with one basic block loops.  */
  		  if (best_edge->dest != bb)
*************** find_traces_1_round (int branch_th, int 
*** 631,637 ****
  					   "Rotating loop %d - %d\n",
  					   best_edge->dest->index, bb->index);
  				}
! 			      bb->rbi->next = best_edge->dest;
  			      bbd[best_edge->dest->index].in_trace = 
  				                             (*n_traces) - 1;
  			      bb = rotate_loop (best_edge, trace, *n_traces);
--- 631,637 ----
  					   "Rotating loop %d - %d\n",
  					   best_edge->dest->index, bb->index);
  				}
! 			      bb->aux = best_edge->dest;
  			      bbd[best_edge->dest->index].in_trace = 
  				                             (*n_traces) - 1;
  			      bb = rotate_loop (best_edge, trace, *n_traces);
*************** find_traces_1_round (int branch_th, int 
*** 681,687 ****
  		    if (e != best_edge
  			&& (e->flags & EDGE_CAN_FALLTHRU)
  			&& !(e->flags & EDGE_COMPLEX)
! 			&& !e->dest->rbi->visited
  			&& single_pred_p (e->dest)
  			&& !(e->flags & EDGE_CROSSING)
  			&& single_succ_p (e->dest)
--- 681,687 ----
  		    if (e != best_edge
  			&& (e->flags & EDGE_CAN_FALLTHRU)
  			&& !(e->flags & EDGE_COMPLEX)
! 			&& !e->dest->il.rtl->visited
  			&& single_pred_p (e->dest)
  			&& !(e->flags & EDGE_CROSSING)
  			&& single_succ_p (e->dest)
*************** find_traces_1_round (int branch_th, int 
*** 698,704 ****
  			break;
  		      }
  
! 		  bb->rbi->next = best_edge->dest;
  		  bbd[best_edge->dest->index].in_trace = (*n_traces) - 1;
  		  bb = best_edge->dest;
  		}
--- 698,704 ----
  			break;
  		      }
  
! 		  bb->aux = best_edge->dest;
  		  bbd[best_edge->dest->index].in_trace = (*n_traces) - 1;
  		  bb = best_edge->dest;
  		}
*************** find_traces_1_round (int branch_th, int 
*** 715,721 ****
        FOR_EACH_EDGE (e, ei, bb->succs)
  	{
  	  if (e->dest == EXIT_BLOCK_PTR
! 	      || e->dest->rbi->visited)
  	    continue;
  
  	  if (bbd[e->dest->index].heap)
--- 715,721 ----
        FOR_EACH_EDGE (e, ei, bb->succs)
  	{
  	  if (e->dest == EXIT_BLOCK_PTR
! 	      || e->dest->il.rtl->visited)
  	    continue;
  
  	  if (bbd[e->dest->index].heap)
*************** copy_bb (basic_block old_bb, edge e, bas
*** 757,771 ****
    BB_COPY_PARTITION (new_bb, old_bb);
  
    gcc_assert (e->dest == new_bb);
!   gcc_assert (!e->dest->rbi->visited);
  
    if (dump_file)
      fprintf (dump_file,
  	     "Duplicated bb %d (created bb %d)\n",
  	     old_bb->index, new_bb->index);
!   new_bb->rbi->visited = trace;
!   new_bb->rbi->next = bb->rbi->next;
!   bb->rbi->next = new_bb;
  
    if (new_bb->index >= array_size || last_basic_block > array_size)
      {
--- 757,771 ----
    BB_COPY_PARTITION (new_bb, old_bb);
  
    gcc_assert (e->dest == new_bb);
!   gcc_assert (!e->dest->il.rtl->visited);
  
    if (dump_file)
      fprintf (dump_file,
  	     "Duplicated bb %d (created bb %d)\n",
  	     old_bb->index, new_bb->index);
!   new_bb->il.rtl->visited = trace;
!   new_bb->aux = bb->aux;
!   bb->aux = new_bb;
  
    if (new_bb->index >= array_size || last_basic_block > array_size)
      {
*************** connect_traces (int n_traces, struct tra
*** 973,979 ****
  	    }
  	  if (best)
  	    {
! 	      best->src->rbi->next = best->dest;
  	      t2 = bbd[best->src->index].end_of_trace;
  	      connected[t2] = true;
  
--- 973,979 ----
  	    }
  	  if (best)
  	    {
! 	      best->src->aux = best->dest;
  	      t2 = bbd[best->src->index].end_of_trace;
  	      connected[t2] = true;
  
*************** connect_traces (int n_traces, struct tra
*** 988,994 ****
  	}
  
        if (last_trace >= 0)
! 	traces[last_trace].last->rbi->next = traces[t2].first;
        last_trace = t;
  
        /* Find the successor traces.  */
--- 988,994 ----
  	}
  
        if (last_trace >= 0)
! 	traces[last_trace].last->aux = traces[t2].first;
        last_trace = t;
  
        /* Find the successor traces.  */
*************** connect_traces (int n_traces, struct tra
*** 1026,1032 ****
  			   best->src->index, best->dest->index);
  		}
  	      t = bbd[best->dest->index].start_of_trace;
! 	      traces[last_trace].last->rbi->next = traces[t].first;
  	      connected[t] = true;
  	      last_trace = t;
  	    }
--- 1026,1032 ----
  			   best->src->index, best->dest->index);
  		}
  	      t = bbd[best->dest->index].start_of_trace;
! 	      traces[last_trace].last->aux = traces[t].first;
  	      connected[t] = true;
  	      last_trace = t;
  	    }
*************** connect_traces (int n_traces, struct tra
*** 1119,1125 ****
  		  if (next_bb && next_bb != EXIT_BLOCK_PTR)
  		    {
  		      t = bbd[next_bb->index].start_of_trace;
! 		      traces[last_trace].last->rbi->next = traces[t].first;
  		      connected[t] = true;
  		      last_trace = t;
  		    }
--- 1119,1125 ----
  		  if (next_bb && next_bb != EXIT_BLOCK_PTR)
  		    {
  		      t = bbd[next_bb->index].start_of_trace;
! 		      traces[last_trace].last->aux = traces[t].first;
  		      connected[t] = true;
  		      last_trace = t;
  		    }
*************** connect_traces (int n_traces, struct tra
*** 1137,1143 ****
        basic_block bb;
  
        fprintf (dump_file, "Final order:\n");
!       for (bb = traces[0].first; bb; bb = bb->rbi->next)
  	fprintf (dump_file, "%d ", bb->index);
        fprintf (dump_file, "\n");
        fflush (dump_file);
--- 1137,1143 ----
        basic_block bb;
  
        fprintf (dump_file, "Final order:\n");
!       for (bb = traces[0].first; bb; bb = bb->aux)
  	fprintf (dump_file, "%d ", bb->index);
        fprintf (dump_file, "\n");
        fflush (dump_file);
*************** add_labels_and_missing_jumps (edge *cros
*** 1305,1311 ****
  		      barrier = emit_barrier_after (new_jump);
  		      JUMP_LABEL (new_jump) = label;
  		      LABEL_NUSES (label) += 1;
! 		      src->rbi->footer = unlink_insn_chain (barrier, barrier);
  		      /* Mark edge as non-fallthru.  */
  		      crossing_edges[i]->flags &= ~EDGE_FALLTHRU;
   		    } /* end: 'if (GET_CODE ... '  */
--- 1305,1311 ----
  		      barrier = emit_barrier_after (new_jump);
  		      JUMP_LABEL (new_jump) = label;
  		      LABEL_NUSES (label) += 1;
! 		      src->il.rtl->footer = unlink_insn_chain (barrier, barrier);
  		      /* Mark edge as non-fallthru.  */
  		      crossing_edges[i]->flags &= ~EDGE_FALLTHRU;
   		    } /* end: 'if (GET_CODE ... '  */
*************** fix_up_fall_thru_edges (void)
*** 1395,1401 ****
   		     the cond jump does).  */
   		  
  		  if (!cond_jump_crosses
! 		      && cur_bb->rbi->next == cond_jump->dest)
   		    {
   		      /* Find label in fall_thru block. We've already added
   		         any missing labels, so there must be one.  */
--- 1395,1401 ----
   		     the cond jump does).  */
   		  
  		  if (!cond_jump_crosses
! 		      && cur_bb->aux == cond_jump->dest)
   		    {
   		      /* Find label in fall_thru block. We've already added
   		         any missing labels, so there must be one.  */
*************** fix_up_fall_thru_edges (void)
*** 1430,1437 ****
  		  
   		  if (new_bb)
   		    {
!  		      new_bb->rbi->next = cur_bb->rbi->next;
!  		      cur_bb->rbi->next = new_bb;
  		      
   		      /* Make sure new fall-through bb is in same 
  			 partition as bb it's falling through from.  */
--- 1430,1437 ----
  		  
   		  if (new_bb)
   		    {
!  		      new_bb->aux = cur_bb->aux;
!  		      cur_bb->aux = new_bb;
  		      
   		      /* Make sure new fall-through bb is in same 
  			 partition as bb it's falling through from.  */
*************** fix_up_fall_thru_edges (void)
*** 1445,1457 ****
   		  if (new_bb)
   		    {
   		      barrier = emit_barrier_after (BB_END (new_bb));
!  		      new_bb->rbi->footer = unlink_insn_chain (barrier, 
   							       barrier);
   		    }
   		  else
   		    {
   		      barrier = emit_barrier_after (BB_END (cur_bb));
!  		      cur_bb->rbi->footer = unlink_insn_chain (barrier,
   							       barrier);
   		    }
   		}
--- 1445,1457 ----
   		  if (new_bb)
   		    {
   		      barrier = emit_barrier_after (BB_END (new_bb));
!  		      new_bb->il.rtl->footer = unlink_insn_chain (barrier, 
   							       barrier);
   		    }
   		  else
   		    {
   		      barrier = emit_barrier_after (BB_END (cur_bb));
!  		      cur_bb->il.rtl->footer = unlink_insn_chain (barrier,
   							       barrier);
   		    }
   		}
*************** fix_crossing_conditional_branches (void)
*** 1597,1604 ****
  		     conditional jump.  */
  		  
  		  new_bb = create_basic_block (NULL, NULL, last_bb);
! 		  new_bb->rbi->next = last_bb->rbi->next;
! 		  last_bb->rbi->next = new_bb;
  		  prev_bb = last_bb;
  		  last_bb = new_bb;
  		  
--- 1597,1604 ----
  		     conditional jump.  */
  		  
  		  new_bb = create_basic_block (NULL, NULL, last_bb);
! 		  new_bb->aux = last_bb->aux;
! 		  last_bb->aux = new_bb;
  		  prev_bb = last_bb;
  		  last_bb = new_bb;
  		  
*************** fix_crossing_conditional_branches (void)
*** 1634,1640 ****
  		  
  		  barrier = emit_barrier_after (new_jump);
  		  JUMP_LABEL (new_jump) = old_label;
! 		  new_bb->rbi->footer = unlink_insn_chain (barrier, 
  							   barrier);
  		  
  		  /* Make sure new bb is in same partition as source
--- 1634,1640 ----
  		  
  		  barrier = emit_barrier_after (new_jump);
  		  JUMP_LABEL (new_jump) = old_label;
! 		  new_bb->il.rtl->footer = unlink_insn_chain (barrier, 
  							   barrier);
  		  
  		  /* Make sure new bb is in same partition as source
*************** duplicate_computed_gotos (void)
*** 2008,2014 ****
  
        /* Build the reorder chain for the original order of blocks.  */
        if (bb->next_bb != EXIT_BLOCK_PTR)
! 	bb->rbi->next = bb->next_bb;
  
        /* Obviously the block has to end in a computed jump.  */
        if (!computed_jump_p (BB_END (bb)))
--- 2008,2014 ----
  
        /* Build the reorder chain for the original order of blocks.  */
        if (bb->next_bb != EXIT_BLOCK_PTR)
! 	bb->aux = bb->next_bb;
  
        /* Obviously the block has to end in a computed jump.  */
        if (!computed_jump_p (BB_END (bb)))
*************** duplicate_computed_gotos (void)
*** 2048,2057 ****
    /* Duplicate computed gotos.  */
    FOR_EACH_BB (bb)
      {
!       if (bb->rbi->visited)
  	continue;
  
!       bb->rbi->visited = 1;
  
        /* BB must have one outgoing edge.  That edge must not lead to
           the exit block or the next block.
--- 2048,2057 ----
    /* Duplicate computed gotos.  */
    FOR_EACH_BB (bb)
      {
!       if (bb->il.rtl->visited)
  	continue;
  
!       bb->il.rtl->visited = 1;
  
        /* BB must have one outgoing edge.  That edge must not lead to
           the exit block or the next block.
*************** duplicate_computed_gotos (void)
*** 2067,2075 ****
  	continue;
  
        new_bb = duplicate_block (single_succ (bb), single_succ_edge (bb));
!       new_bb->rbi->next = bb->rbi->next;
!       bb->rbi->next = new_bb;
!       new_bb->rbi->visited = 1;
      }
  
  done:
--- 2067,2075 ----
  	continue;
  
        new_bb = duplicate_block (single_succ (bb), single_succ_edge (bb));
!       new_bb->aux = bb->aux;
!       bb->aux = new_bb;
!       new_bb->il.rtl->visited = 1;
      }
  
  done:
*************** partition_hot_cold_basic_blocks (void)
*** 2156,2162 ****
    FOR_EACH_BB (cur_bb)
      if (cur_bb->index >= 0
   	&& cur_bb->next_bb->index >= 0)
!       cur_bb->rbi->next = cur_bb->next_bb;
    
    find_rarely_executed_basic_blocks_and_crossing_edges (crossing_edges, 
  							&n_crossing_edges, 
--- 2156,2162 ----
    FOR_EACH_BB (cur_bb)
      if (cur_bb->index >= 0
   	&& cur_bb->next_bb->index >= 0)
!       cur_bb->aux = cur_bb->next_bb;
    
    find_rarely_executed_basic_blocks_and_crossing_edges (crossing_edges, 
  							&n_crossing_edges, 
Index: cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfg.c,v
retrieving revision 1.95
diff -c -3 -p -r1.95 cfg.c
*** cfg.c	16 Jun 2005 10:32:59 -0000	1.95
--- cfg.c	24 Jun 2005 15:31:27 -0000
*************** alloc_block (void)
*** 136,151 ****
    return bb;
  }
  
- /* Initialize rbi (the structure containing data used by basic block
-    duplication and reordering) for the given basic block.  */
- 
- void
- initialize_bb_rbi (basic_block bb)
- {
-   gcc_assert (!bb->rbi);
-   bb->rbi = ggc_alloc_cleared (sizeof (struct reorder_block_def));
- }
- 
  /* Link block B to chain after AFTER.  */
  void
  link_block (basic_block b, basic_block after)
--- 136,141 ----
Index: cfglayout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfglayout.c,v
retrieving revision 1.89
diff -c -3 -p -r1.89 cfglayout.c
*** cfglayout.c	16 Jun 2005 10:33:02 -0000	1.89
--- cfglayout.c	24 Jun 2005 15:31:27 -0000
*************** record_effective_endpoints (void)
*** 209,219 ****
        rtx end;
  
        if (PREV_INSN (BB_HEAD (bb)) && next_insn != BB_HEAD (bb))
! 	bb->rbi->header = unlink_insn_chain (next_insn,
  					      PREV_INSN (BB_HEAD (bb)));
        end = skip_insns_after_block (bb);
        if (NEXT_INSN (BB_END (bb)) && BB_END (bb) != end)
! 	bb->rbi->footer = unlink_insn_chain (NEXT_INSN (BB_END (bb)), end);
        next_insn = NEXT_INSN (BB_END (bb));
      }
  
--- 209,219 ----
        rtx end;
  
        if (PREV_INSN (BB_HEAD (bb)) && next_insn != BB_HEAD (bb))
! 	bb->il.rtl->header = unlink_insn_chain (next_insn,
  					      PREV_INSN (BB_HEAD (bb)));
        end = skip_insns_after_block (bb);
        if (NEXT_INSN (BB_END (bb)) && BB_END (bb) != end)
! 	bb->il.rtl->footer = unlink_insn_chain (NEXT_INSN (BB_END (bb)), end);
        next_insn = NEXT_INSN (BB_END (bb));
      }
  
*************** fixup_reorder_chain (void)
*** 581,596 ****
  
    for (bb = ENTRY_BLOCK_PTR->next_bb, index = 0;
         bb != 0;
!        bb = bb->rbi->next, index++)
      {
!       if (bb->rbi->header)
  	{
  	  if (insn)
! 	    NEXT_INSN (insn) = bb->rbi->header;
  	  else
! 	    set_first_insn (bb->rbi->header);
! 	  PREV_INSN (bb->rbi->header) = insn;
! 	  insn = bb->rbi->header;
  	  while (NEXT_INSN (insn))
  	    insn = NEXT_INSN (insn);
  	}
--- 581,596 ----
  
    for (bb = ENTRY_BLOCK_PTR->next_bb, index = 0;
         bb != 0;
!        bb = bb->aux, index++)
      {
!       if (bb->il.rtl->header)
  	{
  	  if (insn)
! 	    NEXT_INSN (insn) = bb->il.rtl->header;
  	  else
! 	    set_first_insn (bb->il.rtl->header);
! 	  PREV_INSN (bb->il.rtl->header) = insn;
! 	  insn = bb->il.rtl->header;
  	  while (NEXT_INSN (insn))
  	    insn = NEXT_INSN (insn);
  	}
*************** fixup_reorder_chain (void)
*** 600,609 ****
  	set_first_insn (BB_HEAD (bb));
        PREV_INSN (BB_HEAD (bb)) = insn;
        insn = BB_END (bb);
!       if (bb->rbi->footer)
  	{
! 	  NEXT_INSN (insn) = bb->rbi->footer;
! 	  PREV_INSN (bb->rbi->footer) = insn;
  	  while (NEXT_INSN (insn))
  	    insn = NEXT_INSN (insn);
  	}
--- 600,609 ----
  	set_first_insn (BB_HEAD (bb));
        PREV_INSN (BB_HEAD (bb)) = insn;
        insn = BB_END (bb);
!       if (bb->il.rtl->footer)
  	{
! 	  NEXT_INSN (insn) = bb->il.rtl->footer;
! 	  PREV_INSN (bb->il.rtl->footer) = insn;
  	  while (NEXT_INSN (insn))
  	    insn = NEXT_INSN (insn);
  	}
*************** fixup_reorder_chain (void)
*** 627,633 ****
    /* Now add jumps and labels as needed to match the blocks new
       outgoing edges.  */
  
!   for (bb = ENTRY_BLOCK_PTR->next_bb; bb ; bb = bb->rbi->next)
      {
        edge e_fall, e_taken, e;
        rtx bb_end_insn;
--- 627,633 ----
    /* Now add jumps and labels as needed to match the blocks new
       outgoing edges.  */
  
!   for (bb = ENTRY_BLOCK_PTR->next_bb; bb ; bb = bb->aux)
      {
        edge e_fall, e_taken, e;
        rtx bb_end_insn;
*************** fixup_reorder_chain (void)
*** 653,659 ****
  	  if (any_condjump_p (bb_end_insn))
  	    {
  	      /* If the old fallthru is still next, nothing to do.  */
! 	      if (bb->rbi->next == e_fall->dest
  	          || e_fall->dest == EXIT_BLOCK_PTR)
  		continue;
  
--- 653,659 ----
  	  if (any_condjump_p (bb_end_insn))
  	    {
  	      /* If the old fallthru is still next, nothing to do.  */
! 	      if (bb->aux == e_fall->dest
  	          || e_fall->dest == EXIT_BLOCK_PTR)
  		continue;
  
*************** fixup_reorder_chain (void)
*** 696,702 ****
  		 such as happens at the very end of a function, then we'll
  		 need to add a new unconditional jump.  Choose the taken
  		 edge based on known or assumed probability.  */
! 	      else if (bb->rbi->next != e_taken->dest)
  		{
  		  rtx note = find_reg_note (bb_end_insn, REG_BR_PROB, 0);
  
--- 696,702 ----
  		 such as happens at the very end of a function, then we'll
  		 need to add a new unconditional jump.  Choose the taken
  		 edge based on known or assumed probability.  */
! 	      else if (bb->aux != e_taken->dest)
  		{
  		  rtx note = find_reg_note (bb_end_insn, REG_BR_PROB, 0);
  
*************** fixup_reorder_chain (void)
*** 759,765 ****
  	    continue;
  
  	  /* If the fallthru block is still next, nothing to do.  */
! 	  if (bb->rbi->next == e_fall->dest)
  	    continue;
  
  	  /* A fallthru to exit block.  */
--- 759,765 ----
  	    continue;
  
  	  /* If the fallthru block is still next, nothing to do.  */
! 	  if (bb->aux == e_fall->dest)
  	    continue;
  
  	  /* A fallthru to exit block.  */
*************** fixup_reorder_chain (void)
*** 771,780 ****
        nb = force_nonfallthru (e_fall);
        if (nb)
  	{
! 	  initialize_bb_rbi (nb);
! 	  nb->rbi->visited = 1;
! 	  nb->rbi->next = bb->rbi->next;
! 	  bb->rbi->next = nb;
  	  /* Don't process this new block.  */
  	  bb = nb;
  	  
--- 771,779 ----
        nb = force_nonfallthru (e_fall);
        if (nb)
  	{
! 	  nb->il.rtl->visited = 1;
! 	  nb->aux = bb->aux;
! 	  bb->aux = nb;
  	  /* Don't process this new block.  */
  	  bb = nb;
  	  
*************** fixup_reorder_chain (void)
*** 799,805 ****
        fprintf (dump_file, "Reordered sequence:\n");
        for (bb = ENTRY_BLOCK_PTR->next_bb, index = 0;
  	   bb;
! 	   bb = bb->rbi->next, index++)
  	{
  	  fprintf (dump_file, " %i ", index);
  	  if (get_bb_original (bb))
--- 798,804 ----
        fprintf (dump_file, "Reordered sequence:\n");
        for (bb = ENTRY_BLOCK_PTR->next_bb, index = 0;
  	   bb;
! 	   bb = bb->aux, index++)
  	{
  	  fprintf (dump_file, " %i ", index);
  	  if (get_bb_original (bb))
*************** fixup_reorder_chain (void)
*** 818,824 ****
    bb = ENTRY_BLOCK_PTR->next_bb;
    index = 0;
  
!   for (; bb; prev_bb = bb, bb = bb->rbi->next, index ++)
      {
        bb->index = index;
        BASIC_BLOCK (index) = bb;
--- 817,823 ----
    bb = ENTRY_BLOCK_PTR->next_bb;
    index = 0;
  
!   for (; bb; prev_bb = bb, bb = bb->aux, index ++)
      {
        bb->index = index;
        BASIC_BLOCK (index) = bb;
*************** fixup_fallthru_exit_predecessor (void)
*** 890,896 ****
      if (e->flags & EDGE_FALLTHRU)
        bb = e->src;
  
!   if (bb && bb->rbi->next)
      {
        basic_block c = ENTRY_BLOCK_PTR->next_bb;
  
--- 889,895 ----
      if (e->flags & EDGE_FALLTHRU)
        bb = e->src;
  
!   if (bb && bb->aux)
      {
        basic_block c = ENTRY_BLOCK_PTR->next_bb;
  
*************** fixup_fallthru_exit_predecessor (void)
*** 899,920 ****
        if (c == bb)
  	{
  	  bb = split_block (bb, NULL)->dest;
! 	  initialize_bb_rbi (bb);
! 	  bb->rbi->next = c->rbi->next;
! 	  c->rbi->next = bb;
! 	  bb->rbi->footer = c->rbi->footer;
! 	  c->rbi->footer = NULL;
  	}
  
!       while (c->rbi->next != bb)
! 	c = c->rbi->next;
  
!       c->rbi->next = bb->rbi->next;
!       while (c->rbi->next)
! 	c = c->rbi->next;
  
!       c->rbi->next = bb;
!       bb->rbi->next = NULL;
      }
  }
  
--- 898,918 ----
        if (c == bb)
  	{
  	  bb = split_block (bb, NULL)->dest;
! 	  bb->aux = c->aux;
! 	  c->aux = bb;
! 	  bb->il.rtl->footer = c->il.rtl->footer;
! 	  c->il.rtl->footer = NULL;
  	}
  
!       while (c->aux != bb)
! 	c = c->aux;
  
!       c->aux = bb->aux;
!       while (c->aux)
! 	c = c->aux;
  
!       c->aux = bb;
!       bb->aux = NULL;
      }
  }
  
*************** cfg_layout_duplicate_bb (basic_block bb)
*** 1054,1077 ****
  			       EXIT_BLOCK_PTR->prev_bb);
  
    BB_COPY_PARTITION (new_bb, bb);
!   if (bb->rbi->header)
      {
!       insn = bb->rbi->header;
        while (NEXT_INSN (insn))
  	insn = NEXT_INSN (insn);
!       insn = duplicate_insn_chain (bb->rbi->header, insn);
        if (insn)
! 	new_bb->rbi->header = unlink_insn_chain (insn, get_last_insn ());
      }
  
!   if (bb->rbi->footer)
      {
!       insn = bb->rbi->footer;
        while (NEXT_INSN (insn))
  	insn = NEXT_INSN (insn);
!       insn = duplicate_insn_chain (bb->rbi->footer, insn);
        if (insn)
! 	new_bb->rbi->footer = unlink_insn_chain (insn, get_last_insn ());
      }
  
    if (bb->il.rtl->global_live_at_start)
--- 1052,1075 ----
  			       EXIT_BLOCK_PTR->prev_bb);
  
    BB_COPY_PARTITION (new_bb, bb);
!   if (bb->il.rtl->header)
      {
!       insn = bb->il.rtl->header;
        while (NEXT_INSN (insn))
  	insn = NEXT_INSN (insn);
!       insn = duplicate_insn_chain (bb->il.rtl->header, insn);
        if (insn)
! 	new_bb->il.rtl->header = unlink_insn_chain (insn, get_last_insn ());
      }
  
!   if (bb->il.rtl->footer)
      {
!       insn = bb->il.rtl->footer;
        while (NEXT_INSN (insn))
  	insn = NEXT_INSN (insn);
!       insn = duplicate_insn_chain (bb->il.rtl->footer, insn);
        if (insn)
! 	new_bb->il.rtl->footer = unlink_insn_chain (insn, get_last_insn ());
      }
  
    if (bb->il.rtl->global_live_at_start)
*************** cfg_layout_duplicate_bb (basic_block bb)
*** 1097,1107 ****
  void
  cfg_layout_initialize (unsigned int flags)
  {
-   basic_block bb;
- 
-   FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb)
-     initialize_bb_rbi (bb);
- 
    initialize_original_copy_tables ();
  
    cfg_layout_rtl_register_cfg_hooks ();
--- 1095,1100 ----
*************** break_superblocks (void)
*** 1139,1146 ****
    free (superblocks);
  }
  
! /* Finalize the changes: reorder insn list according to the sequence, enter
!    compensation code, rebuild scope forest.  */
  
  void
  cfg_layout_finalize (void)
--- 1132,1139 ----
    free (superblocks);
  }
  
! /* Finalize the changes: reorder insn list according to the sequence specified
!    by aux pointers, enter compensation code, rebuild scope forest.  */
  
  void
  cfg_layout_finalize (void)
*************** cfg_layout_finalize (void)
*** 1163,1169 ****
    verify_insn_chain ();
  #endif
    FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb)
!     bb->rbi = NULL;
  
    break_superblocks ();
  
--- 1156,1166 ----
    verify_insn_chain ();
  #endif
    FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb)
!   {
!     bb->il.rtl->header = bb->il.rtl->footer = NULL;
!     bb->aux = NULL;
!     bb->il.rtl->visited = 0;
!   }
  
    break_superblocks ();
  
Index: cfgrtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgrtl.c,v
retrieving revision 1.176
diff -c -3 -p -r1.176 cfgrtl.c
*** cfgrtl.c	16 Jun 2005 10:33:02 -0000	1.176
--- cfgrtl.c	24 Jun 2005 15:31:28 -0000
*************** cfg_layout_create_basic_block (void *hea
*** 345,351 ****
  {
    basic_block newbb = rtl_create_basic_block (head, end, after);
  
-   initialize_bb_rbi (newbb);
    return newbb;
  }
  
--- 345,350 ----
*************** try_redirect_by_replacing_jump (edge e, 
*** 713,719 ****
        /* Selectively unlink whole insn chain.  */
        if (in_cfglayout)
  	{
! 	  rtx insn = src->rbi->footer;
  
            delete_insn_chain (kill_from, BB_END (src));
  
--- 712,718 ----
        /* Selectively unlink whole insn chain.  */
        if (in_cfglayout)
  	{
! 	  rtx insn = src->il.rtl->footer;
  
            delete_insn_chain (kill_from, BB_END (src));
  
*************** try_redirect_by_replacing_jump (edge e, 
*** 725,731 ****
  		  if (PREV_INSN (insn))
  		    NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn);
  		  else
! 		    src->rbi->footer = NEXT_INSN (insn);
  		  if (NEXT_INSN (insn))
  		    PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn);
  		}
--- 724,730 ----
  		  if (PREV_INSN (insn))
  		    NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn);
  		  else
! 		    src->il.rtl->footer = NEXT_INSN (insn);
  		  if (NEXT_INSN (insn))
  		    PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn);
  		}
*************** cfg_layout_split_block (basic_block bb, 
*** 2490,2497 ****
    rtx insn = insnp;
    basic_block new_bb = rtl_split_block (bb, insn);
  
!   new_bb->rbi->footer = bb->rbi->footer;
!   bb->rbi->footer = NULL;
  
    return new_bb;
  }
--- 2489,2496 ----
    rtx insn = insnp;
    basic_block new_bb = rtl_split_block (bb, insn);
  
!   new_bb->il.rtl->footer = bb->il.rtl->footer;
!   bb->il.rtl->footer = NULL;
  
    return new_bb;
  }
*************** cfg_layout_delete_block (basic_block bb)
*** 2597,2620 ****
  {
    rtx insn, next, prev = PREV_INSN (BB_HEAD (bb)), *to, remaints;
  
!   if (bb->rbi->header)
      {
        next = BB_HEAD (bb);
        if (prev)
! 	NEXT_INSN (prev) = bb->rbi->header;
        else
! 	set_first_insn (bb->rbi->header);
!       PREV_INSN (bb->rbi->header) = prev;
!       insn = bb->rbi->header;
        while (NEXT_INSN (insn))
  	insn = NEXT_INSN (insn);
        NEXT_INSN (insn) = next;
        PREV_INSN (next) = insn;
      }
    next = NEXT_INSN (BB_END (bb));
!   if (bb->rbi->footer)
      {
!       insn = bb->rbi->footer;
        while (insn)
  	{
  	  if (BARRIER_P (insn))
--- 2596,2619 ----
  {
    rtx insn, next, prev = PREV_INSN (BB_HEAD (bb)), *to, remaints;
  
!   if (bb->il.rtl->header)
      {
        next = BB_HEAD (bb);
        if (prev)
! 	NEXT_INSN (prev) = bb->il.rtl->header;
        else
! 	set_first_insn (bb->il.rtl->header);
!       PREV_INSN (bb->il.rtl->header) = prev;
!       insn = bb->il.rtl->header;
        while (NEXT_INSN (insn))
  	insn = NEXT_INSN (insn);
        NEXT_INSN (insn) = next;
        PREV_INSN (next) = insn;
      }
    next = NEXT_INSN (BB_END (bb));
!   if (bb->il.rtl->footer)
      {
!       insn = bb->il.rtl->footer;
        while (insn)
  	{
  	  if (BARRIER_P (insn))
*************** cfg_layout_delete_block (basic_block bb)
*** 2622,2628 ****
  	      if (PREV_INSN (insn))
  		NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn);
  	      else
! 		bb->rbi->footer = NEXT_INSN (insn);
  	      if (NEXT_INSN (insn))
  		PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn);
  	    }
--- 2621,2627 ----
  	      if (PREV_INSN (insn))
  		NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn);
  	      else
! 		bb->il.rtl->footer = NEXT_INSN (insn);
  	      if (NEXT_INSN (insn))
  		PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn);
  	    }
*************** cfg_layout_delete_block (basic_block bb)
*** 2630,2640 ****
  	    break;
  	  insn = NEXT_INSN (insn);
  	}
!       if (bb->rbi->footer)
  	{
  	  insn = BB_END (bb);
! 	  NEXT_INSN (insn) = bb->rbi->footer;
! 	  PREV_INSN (bb->rbi->footer) = insn;
  	  while (NEXT_INSN (insn))
  	    insn = NEXT_INSN (insn);
  	  NEXT_INSN (insn) = next;
--- 2629,2639 ----
  	    break;
  	  insn = NEXT_INSN (insn);
  	}
!       if (bb->il.rtl->footer)
  	{
  	  insn = BB_END (bb);
! 	  NEXT_INSN (insn) = bb->il.rtl->footer;
! 	  PREV_INSN (bb->il.rtl->footer) = insn;
  	  while (NEXT_INSN (insn))
  	    insn = NEXT_INSN (insn);
  	  NEXT_INSN (insn) = next;
*************** cfg_layout_delete_block (basic_block bb)
*** 2645,2656 ****
  	}
      }
    if (bb->next_bb != EXIT_BLOCK_PTR)
!     to = &bb->next_bb->rbi->header;
    else
      to = &cfg_layout_function_footer;
  
-   bb->rbi = NULL;
- 
    rtl_delete_block (bb);
  
    if (prev)
--- 2644,2653 ----
  	}
      }
    if (bb->next_bb != EXIT_BLOCK_PTR)
!     to = &bb->next_bb->il.rtl->header;
    else
      to = &cfg_layout_function_footer;
  
    rtl_delete_block (bb);
  
    if (prev)
*************** cfg_layout_merge_blocks (basic_block a, 
*** 2727,2739 ****
    gcc_assert (!JUMP_P (BB_END (a)));
  
    /* Possible line number notes should appear in between.  */
!   if (b->rbi->header)
      {
        rtx first = BB_END (a), last;
  
!       last = emit_insn_after_noloc (b->rbi->header, BB_END (a));
        delete_insn_chain (NEXT_INSN (first), last);
!       b->rbi->header = NULL;
      }
  
    /* In the case basic blocks are not adjacent, move them around.  */
--- 2724,2736 ----
    gcc_assert (!JUMP_P (BB_END (a)));
  
    /* Possible line number notes should appear in between.  */
!   if (b->il.rtl->header)
      {
        rtx first = BB_END (a), last;
  
!       last = emit_insn_after_noloc (b->il.rtl->header, BB_END (a));
        delete_insn_chain (NEXT_INSN (first), last);
!       b->il.rtl->header = NULL;
      }
  
    /* In the case basic blocks are not adjacent, move them around.  */
*************** cfg_layout_merge_blocks (basic_block a, 
*** 2769,2788 ****
      }
  
    /* Possible tablejumps and barriers should appear after the block.  */
!   if (b->rbi->footer)
      {
!       if (!a->rbi->footer)
! 	a->rbi->footer = b->rbi->footer;
        else
  	{
! 	  rtx last = a->rbi->footer;
  
  	  while (NEXT_INSN (last))
  	    last = NEXT_INSN (last);
! 	  NEXT_INSN (last) = b->rbi->footer;
! 	  PREV_INSN (b->rbi->footer) = last;
  	}
!       b->rbi->footer = NULL;
      }
    a->il.rtl->global_live_at_end = b->il.rtl->global_live_at_end;
  
--- 2766,2785 ----
      }
  
    /* Possible tablejumps and barriers should appear after the block.  */
!   if (b->il.rtl->footer)
      {
!       if (!a->il.rtl->footer)
! 	a->il.rtl->footer = b->il.rtl->footer;
        else
  	{
! 	  rtx last = a->il.rtl->footer;
  
  	  while (NEXT_INSN (last))
  	    last = NEXT_INSN (last);
! 	  NEXT_INSN (last) = b->il.rtl->footer;
! 	  PREV_INSN (b->il.rtl->footer) = last;
  	}
!       b->il.rtl->footer = NULL;
      }
    a->il.rtl->global_live_at_end = b->il.rtl->global_live_at_end;
  
Index: function.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/function.c,v
retrieving revision 1.625
diff -c -3 -p -r1.625 function.c
*** function.c	16 Jun 2005 10:33:08 -0000	1.625
--- function.c	24 Jun 2005 15:31:28 -0000
*************** thread_prologue_and_epilogue_insns (rtx 
*** 5130,5136 ****
        cfg_layout_initialize (0);
        FOR_EACH_BB (cur_bb)
  	if (cur_bb->index >= 0 && cur_bb->next_bb->index >= 0)
! 	  cur_bb->rbi->next = cur_bb->next_bb;
        cfg_layout_finalize ();
      }
  epilogue_done:
--- 5130,5136 ----
        cfg_layout_initialize (0);
        FOR_EACH_BB (cur_bb)
  	if (cur_bb->index >= 0 && cur_bb->next_bb->index >= 0)
! 	  cur_bb->aux = cur_bb->next_bb;
        cfg_layout_finalize ();
      }
  epilogue_done:
Index: passes.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/passes.c,v
retrieving revision 2.92
diff -c -3 -p -r2.92 passes.c
*** passes.c	9 Jun 2005 16:21:35 -0000	2.92
--- passes.c	24 Jun 2005 15:31:28 -0000
*************** rest_of_handle_sms (void)
*** 600,606 ****
    /* Finalize layout changes.  */
    FOR_EACH_BB (bb)
      if (bb->next_bb != EXIT_BLOCK_PTR)
!       bb->rbi->next = bb->next_bb;
    cfg_layout_finalize ();
    free_dominance_info (CDI_DOMINATORS);
    ggc_collect ();
--- 600,606 ----
    /* Finalize layout changes.  */
    FOR_EACH_BB (bb)
      if (bb->next_bb != EXIT_BLOCK_PTR)
!       bb->aux = bb->next_bb;
    cfg_layout_finalize ();
    free_dominance_info (CDI_DOMINATORS);
    ggc_collect ();
*************** rest_of_handle_loop2 (void)
*** 1186,1192 ****
    /* Finalize layout changes.  */
    FOR_EACH_BB (bb)
      if (bb->next_bb != EXIT_BLOCK_PTR)
!       bb->rbi->next = bb->next_bb;
    cfg_layout_finalize ();
  
    cleanup_cfg (CLEANUP_EXPENSIVE);
--- 1186,1192 ----
    /* Finalize layout changes.  */
    FOR_EACH_BB (bb)
      if (bb->next_bb != EXIT_BLOCK_PTR)
!       bb->aux = bb->next_bb;
    cfg_layout_finalize ();
  
    cleanup_cfg (CLEANUP_EXPENSIVE);
Index: tracer.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tracer.c,v
retrieving revision 1.25
diff -c -3 -p -r1.25 tracer.c
*** tracer.c	12 Mar 2005 00:34:04 -0000	1.25
--- tracer.c	24 Jun 2005 15:31:28 -0000
*************** static int branch_ratio_cutoff;
*** 65,71 ****
  /* Return true if BB has been seen - it is connected to some trace
     already.  */
  
! #define seen(bb) (bb->rbi->visited || bb->rbi->next)
  
  /* Return true if we should ignore the basic block for purposes of tracing.  */
  static bool
--- 65,71 ----
  /* Return true if BB has been seen - it is connected to some trace
     already.  */
  
! #define seen(bb) (bb->il.rtl->visited || bb->aux)
  
  /* Return true if we should ignore the basic block for purposes of tracing.  */
  static bool
*************** tail_duplicate (void)
*** 292,299 ****
  		fprintf (dump_file, "Duplicated %i as %i [%i]\n",
  			 old->index, bb2->index, bb2->frequency);
  	    }
! 	  bb->rbi->next = bb2;
! 	  bb2->rbi->visited = 1;
  	  bb = bb2;
  	  /* In case the trace became infrequent, stop duplicating.  */
  	  if (ignore_bb_p (bb))
--- 292,299 ----
  		fprintf (dump_file, "Duplicated %i as %i [%i]\n",
  			 old->index, bb2->index, bb2->frequency);
  	    }
! 	  bb->aux = bb2;
! 	  bb2->il.rtl->visited = 1;
  	  bb = bb2;
  	  /* In case the trace became infrequent, stop duplicating.  */
  	  if (ignore_bb_p (bb))
*************** layout_superblocks (void)
*** 328,355 ****
      {
        edge_iterator ei;
        edge e, best = NULL;
!       while (end->rbi->next)
! 	end = end->rbi->next;
  
        FOR_EACH_EDGE (e, ei, end->succs)
  	if (e->dest != EXIT_BLOCK_PTR
  	    && e->dest != single_succ (ENTRY_BLOCK_PTR)
! 	    && !e->dest->rbi->visited
  	    && (!best || EDGE_FREQUENCY (e) > EDGE_FREQUENCY (best)))
  	  best = e;
  
        if (best)
  	{
! 	  end->rbi->next = best->dest;
! 	  best->dest->rbi->visited = 1;
  	}
        else
  	for (; bb != EXIT_BLOCK_PTR; bb = bb->next_bb)
  	  {
! 	    if (!bb->rbi->visited)
  	      {
! 		end->rbi->next = bb;
! 		bb->rbi->visited = 1;
  		break;
  	      }
  	  }
--- 328,355 ----
      {
        edge_iterator ei;
        edge e, best = NULL;
!       while (end->aux)
! 	end = end->aux;
  
        FOR_EACH_EDGE (e, ei, end->succs)
  	if (e->dest != EXIT_BLOCK_PTR
  	    && e->dest != single_succ (ENTRY_BLOCK_PTR)
! 	    && !e->dest->il.rtl->visited
  	    && (!best || EDGE_FREQUENCY (e) > EDGE_FREQUENCY (best)))
  	  best = e;
  
        if (best)
  	{
! 	  end->aux = best->dest;
! 	  best->dest->il.rtl->visited = 1;
  	}
        else
  	for (; bb != EXIT_BLOCK_PTR; bb = bb->next_bb)
  	  {
! 	    if (!bb->il.rtl->visited)
  	      {
! 		end->aux = bb;
! 		bb->il.rtl->visited = 1;
  		break;
  	      }
  	  }



More information about the Gcc-patches mailing list