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]
Other format: [Raw text]

Basic block renumbering removal, part 2


Hello.

This patch makes us to
 * use prev_bb/next_bb to get to neighbouring basic blocks
 * use ENTRY_BLOCK_PTR->next_bb instead of BASIC_BLOCK (0)
 * use EXIT_BLOCK_PTR->prev_bb instead of BASIC_BLOCK (n_basic_blocks - 1)

Bootstrapped/regtested on i686.

Zdenek Dvorak

Changelog:
	* bb-reorder.c (make_reorder_chain_1): Modified.
	* cfganal.c (can_fallthru, flow_call_edges_add,
	flow_preorder_transversal_compute): Modified.
	* cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks,
	find_sub_basic_blocks): Modified.
	* cfgcleanup.c (try_simplify_condjump, try_optimize_cfg): Modified.
	* cfglayout.c (skip_insns_after_block, fixup_reorder_chain,
	fixup_fallthru_exit_predecessor, cfg_layout_redirect_edge): Modified.
	* cfgrtl.c (tidy_fallthru_edges, verify_flow_info): Modified.
	* combine.c (this_basic_block): Type changed to basic_block.
	(combine_instructions, set_nonzero_bits_and_sign_copies, try_combine,
	nonzero_bits, num_sign_bit_copies, get_last_value_validate,
	get_last_value, distribute_notes, distribute_links): Modified.
	* final.c (compute_alignments): Modified.
	* flow.c (regno_uninitialized, regno_clobbered_at_setjmp): Modified.
	* function.c (thread_prologue_and_epilogue_insns): Modified.
	* gcse.c (compute_code_hoist_vbeinout): Modified.
	* global.c (build_insn_chain): Modified.
	* ifcvt.c (find_if_block, find_cond_trap): Modified.
	* predict.c (last_basic_block_p, note_prediction_to_br_prob): Modified.
	* regmove.c (regmove_optimize): Modified.
	* resource.c (find_basic_block): Modified.
	* sched-ebb.c (schedule_ebbs): Modified.
	* ssa-dce.c (find_control_dependence, find_pdom): Modified.

Index: bb-reorder.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/bb-reorder.c,v
retrieving revision 1.46
diff -c -3 -p -r1.46 bb-reorder.c
*** bb-reorder.c	17 May 2002 02:31:27 -0000	1.46
--- bb-reorder.c	20 May 2002 00:45:11 -0000
*************** make_reorder_chain_1 (bb, prev)
*** 158,164 ****
   restart:
        RBI (prev)->next = bb;
  
!       if (rtl_dump_file && prev->index + 1 != bb->index)
  	fprintf (rtl_dump_file, "Reordering block %d after %d\n",
  		 bb->index, prev->index);
      }
--- 158,164 ----
   restart:
        RBI (prev)->next = bb;
  
!       if (rtl_dump_file && prev->next_bb != bb)
  	fprintf (rtl_dump_file, "Reordering block %d after %d\n",
  		 bb->index, prev->index);
      }
*************** make_reorder_chain_1 (bb, prev)
*** 214,220 ****
    if (! next)
      {
        for (e = bb->succ; e ; e = e->succ_next)
! 	if (e->dest->index == bb->index + 1)
  	  {
  	    if ((e->flags & EDGE_FALLTHRU)
  	        || (e->dest->succ
--- 214,220 ----
    if (! next)
      {
        for (e = bb->succ; e ; e = e->succ_next)
! 	if (e->dest == bb->next_bb)
  	  {
  	    if ((e->flags & EDGE_FALLTHRU)
  	        || (e->dest->succ
Index: cfganal.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfganal.c,v
retrieving revision 1.20
diff -c -3 -p -r1.20 cfganal.c
*** cfganal.c	17 May 2002 02:31:27 -0000	1.20
--- cfganal.c	20 May 2002 00:45:12 -0000
*************** can_fallthru (src, target)
*** 87,93 ****
    rtx insn = src->end;
    rtx insn2 = target->head;
  
!   if (src->index + 1 != target->index)
      return 0;
  
    if (!active_insn_p (insn2))
--- 87,93 ----
    rtx insn = src->end;
    rtx insn2 = target->head;
  
!   if (src->next_bb != target)
      return 0;
  
    if (!active_insn_p (insn2))
*************** flow_call_edges_add (blocks)
*** 296,302 ****
       Handle this by adding a dummy instruction in a new last basic block.  */
    if (check_last_block)
      {
!       basic_block bb = BASIC_BLOCK (n_basic_blocks - 1);
        rtx insn = bb->end;
  
        /* Back up past insns that must be kept in the same block as a call.  */
--- 296,302 ----
       Handle this by adding a dummy instruction in a new last basic block.  */
    if (check_last_block)
      {
!       basic_block bb = EXIT_BLOCK_PTR->prev_bb;
        rtx insn = bb->end;
  
        /* Back up past insns that must be kept in the same block as a call.  */
*************** flow_preorder_transversal_compute (pot_o
*** 1088,1094 ****
       walking the tree from right to left.  */
  
    i = 0;
!   node = &dfst[0];
    pot_order[i++] = 0;
  
    while (node)
--- 1088,1094 ----
       walking the tree from right to left.  */
  
    i = 0;
!   node = &dfst[ENTRY_BLOCK_PTR->next_bb->index];
    pot_order[i++] = 0;
  
    while (node)
Index: cfgbuild.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgbuild.c,v
retrieving revision 1.16
diff -c -3 -p -r1.16 cfgbuild.c
*** cfgbuild.c	19 May 2002 22:25:48 -0000	1.16
--- cfgbuild.c	20 May 2002 00:45:12 -0000
*************** Software Foundation, 59 Temple Place - S
*** 50,56 ****
  static int count_basic_blocks		PARAMS ((rtx));
  static void find_basic_blocks_1		PARAMS ((rtx));
  static rtx find_label_refs		PARAMS ((rtx, rtx));
! static void make_edges			PARAMS ((rtx, int, int, int));
  static void make_label_edge		PARAMS ((sbitmap *, basic_block,
  						 rtx, int));
  static void make_eh_edge		PARAMS ((sbitmap *, basic_block, rtx));
--- 50,57 ----
  static int count_basic_blocks		PARAMS ((rtx));
  static void find_basic_blocks_1		PARAMS ((rtx));
  static rtx find_label_refs		PARAMS ((rtx, rtx));
! static void make_edges			PARAMS ((rtx, basic_block,
! 						 basic_block, int));
  static void make_label_edge		PARAMS ((sbitmap *, basic_block,
  						 rtx, int));
  static void make_eh_edge		PARAMS ((sbitmap *, basic_block, rtx));
*************** make_eh_edge (edge_cache, src, insn)
*** 280,286 ****
  static void
  make_edges (label_value_list, min, max, update_p)
       rtx label_value_list;
!      int min, max, update_p;
  {
    int i;
    sbitmap *edge_cache = NULL;
--- 281,288 ----
  static void
  make_edges (label_value_list, min, max, update_p)
       rtx label_value_list;
!      basic_block min, max;
!      int update_p;
  {
    int i;
    sbitmap *edge_cache = NULL;
*************** make_edges (label_value_list, min, max, 
*** 297,303 ****
        sbitmap_vector_zero (edge_cache, n_basic_blocks);
  
        if (update_p)
! 	for (i = min; i <= max; ++i)
  	  {
  	    edge e;
  
--- 299,305 ----
        sbitmap_vector_zero (edge_cache, n_basic_blocks);
  
        if (update_p)
! 	for (i = min->index; i <= max->index; ++i)
  	  {
  	    edge e;
  
*************** make_edges (label_value_list, min, max, 
*** 308,318 ****
      }
  
    /* By nature of the way these get numbered, block 0 is always the entry.  */
!   if (min == 0)
!     cached_make_edge (edge_cache, ENTRY_BLOCK_PTR, BASIC_BLOCK (0),
  		      EDGE_FALLTHRU);
  
!   for (i = min; i <= max; ++i)
      {
        basic_block bb = BASIC_BLOCK (i);
        rtx insn, x;
--- 310,320 ----
      }
  
    /* By nature of the way these get numbered, block 0 is always the entry.  */
!   if (min == ENTRY_BLOCK_PTR->next_bb)
!     cached_make_edge (edge_cache, ENTRY_BLOCK_PTR, min,
  		      EDGE_FALLTHRU);
  
!   for (i = min->index; i <= max->index; ++i)
      {
        basic_block bb = BASIC_BLOCK (i);
        rtx insn, x;
*************** make_edges (label_value_list, min, max, 
*** 443,458 ****
  
        /* Find out if we can drop through to the next block.  */
        insn = next_nonnote_insn (insn);
!       if (!insn || (i + 1 == n_basic_blocks && force_fallthru))
  	cached_make_edge (edge_cache, bb, EXIT_BLOCK_PTR, EDGE_FALLTHRU);
!       else if (i + 1 < n_basic_blocks)
  	{
! 	  rtx tmp = BLOCK_HEAD (i + 1);
  	  if (GET_CODE (tmp) == NOTE)
  	    tmp = next_nonnote_insn (tmp);
  	  if (force_fallthru || insn == tmp)
! 	    cached_make_edge (edge_cache, bb, BASIC_BLOCK (i + 1),
! 			      EDGE_FALLTHRU);
  	}
      }
  
--- 445,459 ----
  
        /* Find out if we can drop through to the next block.  */
        insn = next_nonnote_insn (insn);
!       if (!insn || (bb->next_bb == EXIT_BLOCK_PTR && force_fallthru))
  	cached_make_edge (edge_cache, bb, EXIT_BLOCK_PTR, EDGE_FALLTHRU);
!       else if (bb->next_bb != EXIT_BLOCK_PTR)
  	{
! 	  rtx tmp = bb->next_bb->head;
  	  if (GET_CODE (tmp) == NOTE)
  	    tmp = next_nonnote_insn (tmp);
  	  if (force_fallthru || insn == tmp)
! 	    cached_make_edge (edge_cache, bb, bb->next_bb, EDGE_FALLTHRU);
  	}
      }
  
*************** find_basic_blocks (f, nregs, file)
*** 664,670 ****
    compute_bb_for_insn (max_uid);
  
    /* Discover the edges of our cfg.  */
!   make_edges (label_value_list, 0, n_basic_blocks - 1, 0);
  
    /* Do very simple cleanup now, for the benefit of code that runs between
       here and cleanup_cfg, e.g. thread_prologue_and_epilogue_insns.  */
--- 665,671 ----
    compute_bb_for_insn (max_uid);
  
    /* Discover the edges of our cfg.  */
!   make_edges (label_value_list, ENTRY_BLOCK_PTR->next_bb, EXIT_BLOCK_PTR->prev_bb, 0);
  
    /* Do very simple cleanup now, for the benefit of code that runs between
       here and cleanup_cfg, e.g. thread_prologue_and_epilogue_insns.  */
*************** find_many_sub_basic_blocks (blocks)
*** 815,821 ****
  
    /* Now re-scan and wire in all edges.  This expect simple (conditional)
       jumps at the end of each new basic blocks.  */
!   make_edges (NULL, min, max, 1);
  
    /* Update branch probabilities.  Expect only (un)conditional jumps
       to be created with only the forward edges.  */
--- 816,822 ----
  
    /* Now re-scan and wire in all edges.  This expect simple (conditional)
       jumps at the end of each new basic blocks.  */
!   make_edges (NULL, BASIC_BLOCK (min), BASIC_BLOCK (max), 1);
  
    /* Update branch probabilities.  Expect only (un)conditional jumps
       to be created with only the forward edges.  */
*************** find_sub_basic_blocks (bb)
*** 852,867 ****
  {
    int i;
    int min, max;
!   basic_block next = (bb->index == n_basic_blocks - 1
! 		      ? NULL : BASIC_BLOCK (bb->index + 1));
  
    min = bb->index;
    find_bb_boundaries (bb);
!   max = (next ? next->index : n_basic_blocks) - 1;
  
    /* Now re-scan and wire in all edges.  This expect simple (conditional)
       jumps at the end of each new basic blocks.  */
!   make_edges (NULL, min, max, 1);
  
    /* Update branch probabilities.  Expect only (un)conditional jumps
       to be created with only the forward edges.  */
--- 853,867 ----
  {
    int i;
    int min, max;
!   basic_block next = bb->next_bb;
  
    min = bb->index;
    find_bb_boundaries (bb);
!   max = next->prev_bb->index;
  
    /* Now re-scan and wire in all edges.  This expect simple (conditional)
       jumps at the end of each new basic blocks.  */
!   make_edges (NULL, BASIC_BLOCK (min), BASIC_BLOCK (max), 1);
  
    /* Update branch probabilities.  Expect only (un)conditional jumps
       to be created with only the forward edges.  */
Index: cfgcleanup.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgcleanup.c,v
retrieving revision 1.56
diff -c -3 -p -r1.56 cfgcleanup.c
*** cfgcleanup.c	19 May 2002 22:25:48 -0000	1.56
--- cfgcleanup.c	20 May 2002 00:45:12 -0000
*************** try_simplify_condjump (cbranch_block)
*** 147,153 ****
       unconditional jump.  */
    jump_block = cbranch_fallthru_edge->dest;
    if (jump_block->pred->pred_next
!       || jump_block->index == n_basic_blocks - 1
        || !FORWARDER_BLOCK_P (jump_block))
      return false;
    jump_dest_block = jump_block->succ->dest;
--- 147,153 ----
       unconditional jump.  */
    jump_block = cbranch_fallthru_edge->dest;
    if (jump_block->pred->pred_next
!       || jump_block->next_bb == EXIT_BLOCK_PTR
        || !FORWARDER_BLOCK_P (jump_block))
      return false;
    jump_dest_block = jump_block->succ->dest;
*************** try_optimize_cfg (mode)
*** 1615,1621 ****
  	      /* Delete trivially dead basic blocks.  */
  	      while (b->pred == NULL)
  		{
! 		  c = BASIC_BLOCK (b->index - 1);
  		  if (rtl_dump_file)
  		    fprintf (rtl_dump_file, "Deleting block %i.\n",
  			     b->index);
--- 1615,1621 ----
  	      /* Delete trivially dead basic blocks.  */
  	      while (b->pred == NULL)
  		{
! 		  c = b->prev_bb;
  		  if (rtl_dump_file)
  		    fprintf (rtl_dump_file, "Deleting block %i.\n",
  			     b->index);
*************** try_optimize_cfg (mode)
*** 1669,1675 ****
  			     "Deleting fallthru block %i.\n",
  			     b->index);
  
! 		  c = BASIC_BLOCK (b->index ? b->index - 1 : 1);
  		  redirect_edge_succ_nodup (b->pred, b->succ->dest);
  		  flow_delete_block (b);
  		  changed = true;
--- 1669,1675 ----
  			     "Deleting fallthru block %i.\n",
  			     b->index);
  
! 		  c = b->prev_bb == ENTRY_BLOCK_PTR ? b->next_bb : b->prev_bb;
  		  redirect_edge_succ_nodup (b->pred, b->succ->dest);
  		  flow_delete_block (b);
  		  changed = true;
Index: cfglayout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfglayout.c,v
retrieving revision 1.14
diff -c -3 -p -r1.14 cfglayout.c
*** cfglayout.c	19 May 2002 22:25:49 -0000	1.14
--- cfglayout.c	20 May 2002 00:45:12 -0000
*************** skip_insns_after_block (bb)
*** 86,93 ****
    rtx insn, last_insn, next_head, prev;
  
    next_head = NULL_RTX;
!   if (bb->index + 1 != n_basic_blocks)
!     next_head = BASIC_BLOCK (bb->index + 1)->head;
  
    for (last_insn = insn = bb->end; (insn = NEXT_INSN (insn)) != 0; )
      {
--- 86,93 ----
    rtx insn, last_insn, next_head, prev;
  
    next_head = NULL_RTX;
!   if (bb->next_bb != EXIT_BLOCK_PTR)
!     next_head = bb->next_bb->head;
  
    for (last_insn = insn = bb->end; (insn = NEXT_INSN (insn)) != 0; )
      {
*************** fixup_reorder_chain ()
*** 364,370 ****
    /* First do the bulk reordering -- rechain the blocks without regard to
       the needed changes to jumps and labels.  */
  
!   for (bb = BASIC_BLOCK (0), index = 0;
         bb != 0;
         bb = RBI (bb)->next, index++)
      {
--- 364,370 ----
    /* First do the bulk reordering -- rechain the blocks without regard to
       the needed changes to jumps and labels.  */
  
!   for (bb = ENTRY_BLOCK_PTR->next_bb, index = 0;
         bb != 0;
         bb = RBI (bb)->next, index++)
      {
*************** fixup_reorder_chain ()
*** 412,418 ****
    /* Now add jumps and labels as needed to match the blocks new
       outgoing edges.  */
  
!   for (bb = BASIC_BLOCK (0); bb ; bb = RBI (bb)->next)
      {
        edge e_fall, e_taken, e;
        rtx bb_end_insn;
--- 412,418 ----
    /* Now add jumps and labels as needed to match the blocks new
       outgoing edges.  */
  
!   for (bb = ENTRY_BLOCK_PTR->next_bb; bb ; bb = RBI (bb)->next)
      {
        edge e_fall, e_taken, e;
        rtx bb_end_insn;
*************** fixup_reorder_chain ()
*** 527,533 ****
    if (rtl_dump_file)
      {
        fprintf (rtl_dump_file, "Reordered sequence:\n");
!       for (bb = BASIC_BLOCK (0), index = 0; bb; bb = RBI (bb)->next, index ++)
  	{
  	  fprintf (rtl_dump_file, " %i ", index);
  	  if (RBI (bb)->original)
--- 527,533 ----
    if (rtl_dump_file)
      {
        fprintf (rtl_dump_file, "Reordered sequence:\n");
!       for (bb = ENTRY_BLOCK_PTR->next_bb, index = 0; bb; bb = RBI (bb)->next, index ++)
  	{
  	  fprintf (rtl_dump_file, " %i ", index);
  	  if (RBI (bb)->original)
*************** fixup_reorder_chain ()
*** 542,548 ****
      }
  
    prev_bb = ENTRY_BLOCK_PTR;
!   bb = BASIC_BLOCK (0);
    index = 0;
  
    for (; bb; prev_bb = bb, bb = RBI (bb)->next, index ++)
--- 542,548 ----
      }
  
    prev_bb = ENTRY_BLOCK_PTR;
!   bb = ENTRY_BLOCK_PTR->next_bb;
    index = 0;
  
    for (; bb; prev_bb = bb, bb = RBI (bb)->next, index ++)
*************** cleanup_unconditional_jumps ()
*** 611,617 ****
  	  rtx insn;
  	  if (GET_CODE (bb->head) != CODE_LABEL && forwarder_block_p (bb) && i)
  	    {
! 	      basic_block prev = BASIC_BLOCK (--i);
  
  	      if (rtl_dump_file)
  		fprintf (rtl_dump_file, "Removing forwarder BB %i\n",
--- 611,619 ----
  	  rtx insn;
  	  if (GET_CODE (bb->head) != CODE_LABEL && forwarder_block_p (bb) && i)
  	    {
! 	      basic_block prev = bb->prev_bb;
! 
! 	      i--;
  
  	      if (rtl_dump_file)
  		fprintf (rtl_dump_file, "Removing forwarder BB %i\n",
*************** fixup_fallthru_exit_predecessor ()
*** 672,678 ****
  
    if (bb && RBI (bb)->next)
      {
!       basic_block c = BASIC_BLOCK (0);
  
        while (RBI (c)->next != bb)
  	c = RBI (c)->next;
--- 674,680 ----
  
    if (bb && RBI (bb)->next)
      {
!       basic_block c = ENTRY_BLOCK_PTR->next_bb;
  
        while (RBI (c)->next != bb)
  	c = RBI (c)->next;
*************** cfg_layout_redirect_edge (e, dest)
*** 822,835 ****
       edge e;
       basic_block dest;
  {
-   int old_index = dest->index;
    basic_block src = e->src;
  
    /* Redirect_edge_and_branch may decide to turn branch into fallthru edge
       in the case the basic block appears to be in sequence.  Avoid this
       transformation.  */
  
!   dest->index = n_basic_blocks + 1;
    if (e->flags & EDGE_FALLTHRU)
      {
        /* In case we are redirecting fallthru edge to the branch edge
--- 824,837 ----
       edge e;
       basic_block dest;
  {
    basic_block src = e->src;
+   basic_block old_next_bb = src->next_bb;
  
    /* Redirect_edge_and_branch may decide to turn branch into fallthru edge
       in the case the basic block appears to be in sequence.  Avoid this
       transformation.  */
  
!   src->next_bb = NULL;
    if (e->flags & EDGE_FALLTHRU)
      {
        /* In case we are redirecting fallthru edge to the branch edge
*************** cfg_layout_redirect_edge (e, dest)
*** 855,861 ****
        delete_barrier (NEXT_INSN (src->end));
        src->succ->flags |= EDGE_FALLTHRU;
      }
!   dest->index = old_index;
  }
  
  /* Create an duplicate of the basic block BB and redirect edge E into it.  */
--- 857,863 ----
        delete_barrier (NEXT_INSN (src->end));
        src->succ->flags |= EDGE_FALLTHRU;
      }
!   src->next_bb = old_next_bb;
  }
  
  /* Create an duplicate of the basic block BB and redirect edge E into it.  */
Index: cfgrtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgrtl.c,v
retrieving revision 1.48
diff -c -3 -p -r1.48 cfgrtl.c
*** cfgrtl.c	19 May 2002 22:25:49 -0000	1.48
--- cfgrtl.c	20 May 2002 00:45:12 -0000
*************** tidy_fallthru_edges ()
*** 1172,1179 ****
  
    for (i = 1; i < n_basic_blocks; i++)
      {
-       basic_block b = BASIC_BLOCK (i - 1);
        basic_block c = BASIC_BLOCK (i);
        edge s;
  
        /* We care about simple conditional or unconditional jumps with
--- 1172,1179 ----
  
    for (i = 1; i < n_basic_blocks; i++)
      {
        basic_block c = BASIC_BLOCK (i);
+       basic_block b = c->prev_bb;
        edge s;
  
        /* We care about simple conditional or unconditional jumps with
*************** verify_flow_info ()
*** 1887,1893 ****
  	    {
  	      rtx insn;
  
! 	      if (e->src->index + 1 != e->dest->index)
  		{
  		  error
  		    ("verify_flow_info: Incorrect blocks for fallthru %i->%i",
--- 1887,1893 ----
  	    {
  	      rtx insn;
  
! 	      if (e->src->next_bb != e->dest)
  		{
  		  error
  		    ("verify_flow_info: Incorrect blocks for fallthru %i->%i",
*************** verify_flow_info ()
*** 1952,1958 ****
  	  err = 1;
  	}
        if (n_branch != 1 && any_condjump_p (bb->end)
! 	  && JUMP_LABEL (bb->end) != BASIC_BLOCK (bb->index + 1)->head)
  	{
  	  error ("Wrong amount of branch edges after conditional jump %i", bb->index);
  	  err = 1;
--- 1952,1958 ----
  	  err = 1;
  	}
        if (n_branch != 1 && any_condjump_p (bb->end)
! 	  && JUMP_LABEL (bb->end) != bb->next_bb->head)
  	{
  	  error ("Wrong amount of branch edges after conditional jump %i", bb->index);
  	  err = 1;
Index: combine.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/combine.c,v
retrieving revision 1.288
diff -c -3 -p -r1.288 combine.c
*** combine.c	17 May 2002 02:31:29 -0000	1.288
--- combine.c	20 May 2002 00:45:13 -0000
*************** static HARD_REG_SET newpat_used_regs;
*** 192,199 ****
  
  static rtx added_links_insn;
  
! /* Basic block number of the block in which we are performing combines.  */
! static int this_basic_block;
  
  /* A bitmap indicating which blocks had registers go dead at entry.
     After combine, we'll need to re-do global life analysis with
--- 192,199 ----
  
  static rtx added_links_insn;
  
! /* Basic block in which we are performing combines.  */
! static basic_block this_basic_block;
  
  /* A bitmap indicating which blocks had registers go dead at entry.
     After combine, we'll need to re-do global life analysis with
*************** combine_instructions (f, nregs)
*** 610,616 ****
  
    /* Now scan all the insns in forward order.  */
  
!   this_basic_block = -1;
    label_tick = 1;
    last_call_cuid = 0;
    mem_last_set = 0;
--- 610,616 ----
  
    /* Now scan all the insns in forward order.  */
  
!   this_basic_block = ENTRY_BLOCK_PTR;
    label_tick = 1;
    last_call_cuid = 0;
    mem_last_set = 0;
*************** combine_instructions (f, nregs)
*** 622,630 ****
        next = 0;
  
        /* If INSN starts a new basic block, update our basic block number.  */
!       if (this_basic_block + 1 < n_basic_blocks
! 	  && BLOCK_HEAD (this_basic_block + 1) == insn)
! 	this_basic_block++;
  
        if (GET_CODE (insn) == CODE_LABEL)
  	label_tick++;
--- 622,630 ----
        next = 0;
  
        /* If INSN starts a new basic block, update our basic block number.  */
!       if (this_basic_block->next_bb != EXIT_BLOCK_PTR
! 	  && this_basic_block->next_bb->head == insn)
! 	this_basic_block = this_basic_block->next_bb;
  
        if (GET_CODE (insn) == CODE_LABEL)
  	label_tick++;
*************** combine_instructions (f, nregs)
*** 741,748 ****
      }
    clear_bb_flags ();
  
!   EXECUTE_IF_SET_IN_SBITMAP (refresh_blocks, 0, this_basic_block,
! 			     BASIC_BLOCK (this_basic_block)->flags |= BB_DIRTY);
    new_direct_jump_p |= purge_all_dead_edges (0);
    delete_noop_moves (f);
  
--- 741,748 ----
      }
    clear_bb_flags ();
  
!   EXECUTE_IF_SET_IN_SBITMAP (refresh_blocks, 0, i,
! 			     BASIC_BLOCK (i)->flags |= BB_DIRTY);
    new_direct_jump_p |= purge_all_dead_edges (0);
    delete_noop_moves (f);
  
*************** set_nonzero_bits_and_sign_copies (x, set
*** 860,866 ****
        && REGNO (x) >= FIRST_PSEUDO_REGISTER
        /* If this register is undefined at the start of the file, we can't
  	 say what its contents were.  */
!       && ! REGNO_REG_SET_P (BASIC_BLOCK (0)->global_live_at_start, REGNO (x))
        && GET_MODE_BITSIZE (GET_MODE (x)) <= HOST_BITS_PER_WIDE_INT)
      {
        if (set == 0 || GET_CODE (set) == CLOBBER)
--- 860,866 ----
        && REGNO (x) >= FIRST_PSEUDO_REGISTER
        /* If this register is undefined at the start of the file, we can't
  	 say what its contents were.  */
!       && ! REGNO_REG_SET_P (ENTRY_BLOCK_PTR->next_bb->global_live_at_start, REGNO (x))
        && GET_MODE_BITSIZE (GET_MODE (x)) <= HOST_BITS_PER_WIDE_INT)
      {
        if (set == 0 || GET_CODE (set) == CLOBBER)
*************** try_combine (i3, i2, i1, new_direct_jump
*** 2390,2397 ****
  	     which we know will be a NOTE.  */
  
  	  for (insn = NEXT_INSN (i3);
! 	       insn && (this_basic_block == n_basic_blocks - 1
! 			|| insn != BLOCK_HEAD (this_basic_block + 1));
  	       insn = NEXT_INSN (insn))
  	    {
  	      if (INSN_P (insn) && reg_referenced_p (ni2dest, PATTERN (insn)))
--- 2390,2397 ----
  	     which we know will be a NOTE.  */
  
  	  for (insn = NEXT_INSN (i3);
! 	       insn && (this_basic_block->next_bb == EXIT_BLOCK_PTR
! 			|| insn != this_basic_block->next_bb->head);
  	       insn = NEXT_INSN (insn))
  	    {
  	      if (INSN_P (insn) && reg_referenced_p (ni2dest, PATTERN (insn)))
*************** try_combine (i3, i2, i1, new_direct_jump
*** 2608,2615 ****
  	      && ! find_reg_note (i2, REG_UNUSED,
  				  SET_DEST (XVECEXP (PATTERN (i2), 0, i))))
  	    for (temp = NEXT_INSN (i2);
! 		 temp && (this_basic_block == n_basic_blocks - 1
! 			  || BLOCK_HEAD (this_basic_block) != temp);
  		 temp = NEXT_INSN (temp))
  	      if (temp != i3 && INSN_P (temp))
  		for (link = LOG_LINKS (temp); link; link = XEXP (link, 1))
--- 2608,2615 ----
  	      && ! find_reg_note (i2, REG_UNUSED,
  				  SET_DEST (XVECEXP (PATTERN (i2), 0, i))))
  	    for (temp = NEXT_INSN (i2);
! 		 temp && (this_basic_block->next_bb == EXIT_BLOCK_PTR
! 			  || this_basic_block->head != temp);
  		 temp = NEXT_INSN (temp))
  	      if (temp != i3 && INSN_P (temp))
  		for (link = LOG_LINKS (temp); link; link = XEXP (link, 1))
*************** nonzero_bits (x, mode)
*** 8070,8076 ****
  	  && (reg_last_set_label[REGNO (x)] == label_tick
  	      || (REGNO (x) >= FIRST_PSEUDO_REGISTER
  		  && REG_N_SETS (REGNO (x)) == 1
! 		  && ! REGNO_REG_SET_P (BASIC_BLOCK (0)->global_live_at_start,
  					REGNO (x))))
  	  && INSN_CUID (reg_last_set[REGNO (x)]) < subst_low_cuid)
  	return reg_last_set_nonzero_bits[REGNO (x)] & nonzero;
--- 8070,8076 ----
  	  && (reg_last_set_label[REGNO (x)] == label_tick
  	      || (REGNO (x) >= FIRST_PSEUDO_REGISTER
  		  && REG_N_SETS (REGNO (x)) == 1
! 		  && ! REGNO_REG_SET_P (ENTRY_BLOCK_PTR->next_bb->global_live_at_start,
  					REGNO (x))))
  	  && INSN_CUID (reg_last_set[REGNO (x)]) < subst_low_cuid)
  	return reg_last_set_nonzero_bits[REGNO (x)] & nonzero;
*************** num_sign_bit_copies (x, mode)
*** 8485,8491 ****
  	  && (reg_last_set_label[REGNO (x)] == label_tick
  	      || (REGNO (x) >= FIRST_PSEUDO_REGISTER
  		  && REG_N_SETS (REGNO (x)) == 1
! 		  && ! REGNO_REG_SET_P (BASIC_BLOCK (0)->global_live_at_start,
  					REGNO (x))))
  	  && INSN_CUID (reg_last_set[REGNO (x)]) < subst_low_cuid)
  	return reg_last_set_sign_bit_copies[REGNO (x)];
--- 8485,8491 ----
  	  && (reg_last_set_label[REGNO (x)] == label_tick
  	      || (REGNO (x) >= FIRST_PSEUDO_REGISTER
  		  && REG_N_SETS (REGNO (x)) == 1
! 		  && ! REGNO_REG_SET_P (ENTRY_BLOCK_PTR->next_bb->global_live_at_start,
  					REGNO (x))))
  	  && INSN_CUID (reg_last_set[REGNO (x)]) < subst_low_cuid)
  	return reg_last_set_sign_bit_copies[REGNO (x)];
*************** get_last_value_validate (loc, insn, tick
*** 11494,11500 ****
  	    || (! (regno >= FIRST_PSEUDO_REGISTER
  		   && REG_N_SETS (regno) == 1
  		   && (! REGNO_REG_SET_P
! 		       (BASIC_BLOCK (0)->global_live_at_start, regno)))
  		&& reg_last_set_label[j] > tick))
  	  {
  	    if (replace)
--- 11494,11500 ----
  	    || (! (regno >= FIRST_PSEUDO_REGISTER
  		   && REG_N_SETS (regno) == 1
  		   && (! REGNO_REG_SET_P
! 		       (ENTRY_BLOCK_PTR->next_bb->global_live_at_start, regno)))
  		&& reg_last_set_label[j] > tick))
  	  {
  	    if (replace)
*************** get_last_value (x)
*** 11568,11574 ****
  	  && (regno < FIRST_PSEUDO_REGISTER
  	      || REG_N_SETS (regno) != 1
  	      || (REGNO_REG_SET_P
! 		  (BASIC_BLOCK (0)->global_live_at_start, regno)))))
      return 0;
  
    /* If the value was set in a later insn than the ones we are processing,
--- 11568,11574 ----
  	  && (regno < FIRST_PSEUDO_REGISTER
  	      || REG_N_SETS (regno) != 1
  	      || (REGNO_REG_SET_P
! 		  (ENTRY_BLOCK_PTR->next_bb->global_live_at_start, regno)))))
      return 0;
  
    /* If the value was set in a later insn than the ones we are processing,
*************** distribute_notes (notes, from_insn, i3, 
*** 12377,12383 ****
  
  	  if (place == 0)
  	    {
! 	      basic_block bb = BASIC_BLOCK (this_basic_block);
  
  	      for (tem = PREV_INSN (i3); place == 0; tem = PREV_INSN (tem))
  		{
--- 12377,12383 ----
  
  	  if (place == 0)
  	    {
! 	      basic_block bb = this_basic_block;
  
  	      for (tem = PREV_INSN (i3); place == 0; tem = PREV_INSN (tem))
  		{
*************** distribute_notes (notes, from_insn, i3, 
*** 12521,12527 ****
  		  && REGNO_REG_SET_P (bb->global_live_at_start,
  				      REGNO (XEXP (note, 0))))
  		{
! 		  SET_BIT (refresh_blocks, this_basic_block);
  		  need_refresh = 1;
  		}
  	    }
--- 12521,12527 ----
  		  && REGNO_REG_SET_P (bb->global_live_at_start,
  				      REGNO (XEXP (note, 0))))
  		{
! 		  SET_BIT (refresh_blocks, this_basic_block->index);
  		  need_refresh = 1;
  		}
  	    }
*************** distribute_notes (notes, from_insn, i3, 
*** 12541,12547 ****
  		 after we remove them in delete_noop_moves.  */
  	      if (noop_move_p (place))
  		{
! 		  SET_BIT (refresh_blocks, this_basic_block);
  		  need_refresh = 1;
  		}
  
--- 12541,12547 ----
  		 after we remove them in delete_noop_moves.  */
  	      if (noop_move_p (place))
  		{
! 		  SET_BIT (refresh_blocks, this_basic_block->index);
  		  need_refresh = 1;
  		}
  
*************** distribute_notes (notes, from_insn, i3, 
*** 12591,12597 ****
  			   i += HARD_REGNO_NREGS (i, reg_raw_mode[i]))
  			{
  			  rtx piece = gen_rtx_REG (reg_raw_mode[i], i);
! 			  basic_block bb = BASIC_BLOCK (this_basic_block);
  
  			  if (! dead_or_set_p (place, piece)
  			      && ! reg_bitfield_target_p (piece,
--- 12591,12597 ----
  			   i += HARD_REGNO_NREGS (i, reg_raw_mode[i]))
  			{
  			  rtx piece = gen_rtx_REG (reg_raw_mode[i], i);
! 			  basic_block bb = this_basic_block;
  
  			  if (! dead_or_set_p (place, piece)
  			      && ! reg_bitfield_target_p (piece,
*************** distribute_notes (notes, from_insn, i3, 
*** 12614,12620 ****
  				    if (tem == bb->head)
  				      {
  					SET_BIT (refresh_blocks,
! 						 this_basic_block);
  					need_refresh = 1;
  					break;
  				      }
--- 12614,12620 ----
  				    if (tem == bb->head)
  				      {
  					SET_BIT (refresh_blocks,
! 						 this_basic_block->index);
  					need_refresh = 1;
  					break;
  				      }
*************** distribute_links (links)
*** 12719,12726 ****
  	 since most links don't point very far away.  */
  
        for (insn = NEXT_INSN (XEXP (link, 0));
! 	   (insn && (this_basic_block == n_basic_blocks - 1
! 		     || BLOCK_HEAD (this_basic_block + 1) != insn));
  	   insn = NEXT_INSN (insn))
  	if (INSN_P (insn) && reg_overlap_mentioned_p (reg, PATTERN (insn)))
  	  {
--- 12719,12726 ----
  	 since most links don't point very far away.  */
  
        for (insn = NEXT_INSN (XEXP (link, 0));
! 	   (insn && (this_basic_block->next_bb == EXIT_BLOCK_PTR
! 		     || this_basic_block->next_bb->head != insn));
  	   insn = NEXT_INSN (insn))
  	if (INSN_P (insn) && reg_overlap_mentioned_p (reg, PATTERN (insn)))
  	  {
Index: final.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/final.c,v
retrieving revision 1.254
diff -c -3 -p -r1.254 final.c
*** final.c	18 May 2002 19:27:41 -0000	1.254
--- final.c	20 May 2002 00:45:14 -0000
*************** compute_alignments ()
*** 984,991 ****
  
        if (!has_fallthru
  	  && (branch_frequency > BB_FREQ_MAX / 10
! 	      || (bb->frequency > BASIC_BLOCK (i - 1)->frequency * 10
! 		  && (BASIC_BLOCK (i - 1)->frequency
  		      <= ENTRY_BLOCK_PTR->frequency / 2))))
  	{
  	  log = JUMP_ALIGN (label);
--- 984,991 ----
  
        if (!has_fallthru
  	  && (branch_frequency > BB_FREQ_MAX / 10
! 	      || (bb->frequency > bb->prev_bb->frequency * 10
! 		  && (bb->prev_bb->frequency
  		      <= ENTRY_BLOCK_PTR->frequency / 2))))
  	{
  	  log = JUMP_ALIGN (label);
Index: flow.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/flow.c,v
retrieving revision 1.520
diff -c -3 -p -r1.520 flow.c
*** flow.c	17 May 2002 18:06:59 -0000	1.520
--- flow.c	20 May 2002 00:45:14 -0000
*************** regno_uninitialized (regno)
*** 2349,2355 ****
  	      || FUNCTION_ARG_REGNO_P (regno))))
      return 0;
  
!   return REGNO_REG_SET_P (BASIC_BLOCK (0)->global_live_at_start, regno);
  }
  
  /* 1 if register REGNO was alive at a place where `setjmp' was called
--- 2349,2355 ----
  	      || FUNCTION_ARG_REGNO_P (regno))))
      return 0;
  
!   return REGNO_REG_SET_P (ENTRY_BLOCK_PTR->next_bb->global_live_at_start, regno);
  }
  
  /* 1 if register REGNO was alive at a place where `setjmp' was called
*************** regno_clobbered_at_setjmp (regno)
*** 2364,2370 ****
      return 0;
  
    return ((REG_N_SETS (regno) > 1
! 	   || REGNO_REG_SET_P (BASIC_BLOCK (0)->global_live_at_start, regno))
  	  && REGNO_REG_SET_P (regs_live_at_setjmp, regno));
  }
  
--- 2364,2370 ----
      return 0;
  
    return ((REG_N_SETS (regno) > 1
! 	   || REGNO_REG_SET_P (ENTRY_BLOCK_PTR->next_bb->global_live_at_start, regno))
  	  && REGNO_REG_SET_P (regs_live_at_setjmp, regno));
  }
  
Index: function.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/function.c,v
retrieving revision 1.367
diff -c -3 -p -r1.367 function.c
*** function.c	17 May 2002 18:07:01 -0000	1.367
--- function.c	20 May 2002 00:45:14 -0000
*************** epilogue_done:
*** 7817,7823 ****
  	}
  
        /* Find the last line number note in the first block.  */
!       for (insn = BASIC_BLOCK (0)->end;
  	   insn != prologue_end && insn;
  	   insn = PREV_INSN (insn))
  	if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0)
--- 7817,7823 ----
  	}
  
        /* Find the last line number note in the first block.  */
!       for (insn = ENTRY_BLOCK_PTR->next_bb->end;
  	   insn != prologue_end && insn;
  	   insn = PREV_INSN (insn))
  	if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0)
Index: gcse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcse.c,v
retrieving revision 1.187
diff -c -3 -p -r1.187 gcse.c
*** gcse.c	17 May 2002 02:31:34 -0000	1.187
--- gcse.c	20 May 2002 00:45:15 -0000
*************** compute_code_hoist_vbeinout ()
*** 5586,5592 ****
  	{
  	  changed |= sbitmap_a_or_b_and_c_cg (hoist_vbein[bb], antloc[bb],
  					      hoist_vbeout[bb], transp[bb]);
! 	  if (bb != n_basic_blocks - 1)
  	    sbitmap_intersection_of_succs (hoist_vbeout[bb], hoist_vbein, bb);
  	}
  
--- 5586,5592 ----
  	{
  	  changed |= sbitmap_a_or_b_and_c_cg (hoist_vbein[bb], antloc[bb],
  					      hoist_vbeout[bb], transp[bb]);
! 	  if (BASIC_BLOCK (bb)->next_bb != EXIT_BLOCK_PTR)
  	    sbitmap_intersection_of_succs (hoist_vbeout[bb], hoist_vbein, bb);
  	}
  
Index: global.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/global.c,v
retrieving revision 1.79
diff -c -3 -p -r1.79 global.c
*** global.c	17 May 2002 02:31:34 -0000	1.79
--- global.c	20 May 2002 00:45:15 -0000
*************** build_insn_chain (first)
*** 1794,1800 ****
  {
    struct insn_chain **p = &reload_insn_chain;
    struct insn_chain *prev = 0;
!   int b = 0;
    regset_head live_relevant_regs_head;
  
    live_relevant_regs = INITIALIZE_REG_SET (live_relevant_regs_head);
--- 1794,1800 ----
  {
    struct insn_chain **p = &reload_insn_chain;
    struct insn_chain *prev = 0;
!   basic_block b = ENTRY_BLOCK_PTR->next_bb;
    regset_head live_relevant_regs_head;
  
    live_relevant_regs = INITIALIZE_REG_SET (live_relevant_regs_head);
*************** build_insn_chain (first)
*** 1803,1816 ****
      {
        struct insn_chain *c;
  
!       if (first == BLOCK_HEAD (b))
  	{
  	  int i;
  
  	  CLEAR_REG_SET (live_relevant_regs);
  
  	  EXECUTE_IF_SET_IN_BITMAP
! 	    (BASIC_BLOCK (b)->global_live_at_start, 0, i,
  	     {
  	       if (i < FIRST_PSEUDO_REGISTER
  		   ? ! TEST_HARD_REG_BIT (eliminable_regset, i)
--- 1803,1816 ----
      {
        struct insn_chain *c;
  
!       if (first == b->head)
  	{
  	  int i;
  
  	  CLEAR_REG_SET (live_relevant_regs);
  
  	  EXECUTE_IF_SET_IN_BITMAP
! 	    (b->global_live_at_start, 0, i,
  	     {
  	       if (i < FIRST_PSEUDO_REGISTER
  		   ? ! TEST_HARD_REG_BIT (eliminable_regset, i)
*************** build_insn_chain (first)
*** 1827,1833 ****
  	  *p = c;
  	  p = &c->next;
  	  c->insn = first;
! 	  c->block = b;
  
  	  if (INSN_P (first))
  	    {
--- 1827,1833 ----
  	  *p = c;
  	  p = &c->next;
  	  c->insn = first;
! 	  c->block = b->index;
  
  	  if (INSN_P (first))
  	    {
*************** build_insn_chain (first)
*** 1865,1872 ****
  	    }
  	}
  
!       if (first == BLOCK_END (b))
! 	b++;
  
        /* Stop after we pass the end of the last basic block.  Verify that
  	 no real insns are after the end of the last basic block.
--- 1865,1872 ----
  	    }
  	}
  
!       if (first == b->end)
! 	b = b->next_bb;
  
        /* Stop after we pass the end of the last basic block.  Verify that
  	 no real insns are after the end of the last basic block.
*************** build_insn_chain (first)
*** 1874,1880 ****
  	 We may want to reorganize the loop somewhat since this test should
  	 always be the right exit test.  Allow an ADDR_VEC or ADDR_DIF_VEC if
  	 the previous real insn is a JUMP_INSN.  */
!       if (b == n_basic_blocks)
  	{
  	  for (first = NEXT_INSN (first) ; first; first = NEXT_INSN (first))
  	    if (INSN_P (first)
--- 1874,1880 ----
  	 We may want to reorganize the loop somewhat since this test should
  	 always be the right exit test.  Allow an ADDR_VEC or ADDR_DIF_VEC if
  	 the previous real insn is a JUMP_INSN.  */
!       if (b == EXIT_BLOCK_PTR)
  	{
  	  for (first = NEXT_INSN (first) ; first; first = NEXT_INSN (first))
  	    if (INSN_P (first)
Index: ifcvt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ifcvt.c,v
retrieving revision 1.89
diff -c -3 -p -r1.89 ifcvt.c
*** ifcvt.c	17 May 2002 02:31:36 -0000	1.89
--- ifcvt.c	20 May 2002 00:45:15 -0000
*************** find_if_block (test_bb, then_edge, else_
*** 1973,1979 ****
    basic_block join_bb = NULL_BLOCK;
    edge then_succ = then_bb->succ;
    edge else_succ = else_bb->succ;
!   int next_index;
  
    /* The THEN block of an IF-THEN combo must have exactly one predecessor.  */
    if (then_bb->pred->pred_next != NULL_EDGE)
--- 1973,1979 ----
    basic_block join_bb = NULL_BLOCK;
    edge then_succ = then_bb->succ;
    edge else_succ = else_bb->succ;
!   basic_block next;
  
    /* The THEN block of an IF-THEN combo must have exactly one predecessor.  */
    if (then_bb->pred->pred_next != NULL_EDGE)
*************** find_if_block (test_bb, then_edge, else_
*** 2057,2066 ****
    /* ??? As an enhancement, move the ELSE block.  Have to deal with
       BLOCK notes, if by no other means than aborting the merge if they
       exist.  Sticky enough I don't want to think about it now.  */
!   next_index = then_bb->index;
!   if (else_bb && ++next_index != else_bb->index)
      return FALSE;
!   if (++next_index != join_bb->index && join_bb->index != EXIT_BLOCK)
      {
        if (else_bb)
  	join_bb = NULL;
--- 2057,2066 ----
    /* ??? As an enhancement, move the ELSE block.  Have to deal with
       BLOCK notes, if by no other means than aborting the merge if they
       exist.  Sticky enough I don't want to think about it now.  */
!   next = then_bb;
!   if (else_bb && (next = next->next_bb) != else_bb)
      return FALSE;
!   if ((next = next->next_bb) != join_bb && join_bb != EXIT_BLOCK_PTR)
      {
        if (else_bb)
  	join_bb = NULL;
*************** find_cond_trap (test_bb, then_edge, else
*** 2146,2152 ****
  
    /* If the non-trap block and the test are now adjacent, merge them.
       Otherwise we must insert a direct branch.  */
!   if (test_bb->index + 1 == other_bb->index)
      {
        delete_insn (jump);
        merge_if_block (test_bb, NULL, NULL, other_bb);
--- 2146,2152 ----
  
    /* If the non-trap block and the test are now adjacent, merge them.
       Otherwise we must insert a direct branch.  */
!   if (test_bb->next_bb == other_bb)
      {
        delete_insn (jump);
        merge_if_block (test_bb, NULL, NULL, other_bb);
Index: predict.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/predict.c,v
retrieving revision 1.65
diff -c -3 -p -r1.65 predict.c
*** predict.c	17 May 2002 02:31:42 -0000	1.65
--- predict.c	20 May 2002 00:45:15 -0000
*************** static bool
*** 695,704 ****
  last_basic_block_p (bb)
       basic_block bb;
  {
!   return (bb->index == n_basic_blocks - 1
! 	  || (bb->index == n_basic_blocks - 2
  	      && bb->succ && !bb->succ->succ_next
! 	      && bb->succ->dest->index == n_basic_blocks - 1));
  }
  
  /* Sets branch probabilities according to PREDiction and FLAGS. HEADS[bb->index]
--- 695,707 ----
  last_basic_block_p (bb)
       basic_block bb;
  {
!   if (bb == EXIT_BLOCK_PTR)
!     return false;
! 
!   return (bb->next_bb == EXIT_BLOCK_PTR
! 	  || (bb->next_bb->next_bb == EXIT_BLOCK_PTR
  	      && bb->succ && !bb->succ->succ_next
! 	      && bb->succ->dest->next_bb == EXIT_BLOCK_PTR));
  }
  
  /* Sets branch probabilities according to PREDiction and FLAGS. HEADS[bb->index]
*************** note_prediction_to_br_prob ()
*** 847,853 ****
  
    heads = xmalloc (sizeof (int) * n_basic_blocks);
    memset (heads, -1, sizeof (int) * n_basic_blocks);
!   heads[0] = n_basic_blocks;
  
    /* Process all prediction notes.  */
  
--- 850,856 ----
  
    heads = xmalloc (sizeof (int) * n_basic_blocks);
    memset (heads, -1, sizeof (int) * n_basic_blocks);
!   heads[ENTRY_BLOCK_PTR->next_bb->index] = n_basic_blocks;
  
    /* Process all prediction notes.  */
  
Index: regmove.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/regmove.c,v
retrieving revision 1.128
diff -c -3 -p -r1.128 regmove.c
*** regmove.c	17 May 2002 02:31:51 -0000	1.128
--- regmove.c	20 May 2002 00:45:15 -0000
*************** regmove_optimize (f, nregs, regmove_dump
*** 1506,1518 ****
       ends.  Fix that here.  */
    for (i = 0; i < n_basic_blocks; i++)
      {
!       rtx end = BLOCK_END (i);
        rtx new = end;
        rtx next = NEXT_INSN (new);
        while (next != 0 && INSN_UID (next) >= old_max_uid
! 	     && (i == n_basic_blocks - 1 || BLOCK_HEAD (i + 1) != next))
  	new = next, next = NEXT_INSN (new);
!       BLOCK_END (i) = new;
      }
  
   done:
--- 1506,1519 ----
       ends.  Fix that here.  */
    for (i = 0; i < n_basic_blocks; i++)
      {
!       basic_block bb = BASIC_BLOCK (i);
!       rtx end = bb->end;
        rtx new = end;
        rtx next = NEXT_INSN (new);
        while (next != 0 && INSN_UID (next) >= old_max_uid
! 	     && (bb->next_bb == EXIT_BLOCK_PTR || bb->next_bb->head != next))
  	new = next, next = NEXT_INSN (new);
!       bb->end = new;
      }
  
   done:
Index: resource.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/resource.c,v
retrieving revision 1.55
diff -c -3 -p -r1.55 resource.c
*** resource.c	17 May 2002 02:31:55 -0000	1.55
--- resource.c	20 May 2002 00:45:15 -0000
*************** find_basic_block (insn, search_limit)
*** 146,154 ****
    if (search_limit == 0)
      return -1;
  
!   /* The start of the function is basic block zero.  */
    else if (insn == 0)
!     return 0;
  
    /* See if any of the upcoming CODE_LABELs start a basic block.  If we reach
       anything other than a CODE_LABEL or note, we can't find this code.  */
--- 146,154 ----
    if (search_limit == 0)
      return -1;
  
!   /* The start of the function.  */
    else if (insn == 0)
!     return ENTRY_BLOCK_PTR->next_bb->index;
  
    /* See if any of the upcoming CODE_LABELs start a basic block.  If we reach
       anything other than a CODE_LABEL or note, we can't find this code.  */
Index: sched-ebb.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/sched-ebb.c,v
retrieving revision 1.12
diff -c -3 -p -r1.12 sched-ebb.c
*** sched-ebb.c	17 May 2002 02:31:55 -0000	1.12
--- sched-ebb.c	20 May 2002 00:45:15 -0000
*************** schedule_ebbs (dump_file)
*** 306,313 ****
  	  basic_block b = BASIC_BLOCK (i);
  	  edge e;
  	  tail = b->end;
! 	  if (i + 1 == n_basic_blocks
! 	      || GET_CODE (BLOCK_HEAD (i + 1)) == CODE_LABEL)
  	    break;
  	  for (e = b->succ; e; e = e->succ_next)
  	    if ((e->flags & EDGE_FALLTHRU) != 0)
--- 306,313 ----
  	  basic_block b = BASIC_BLOCK (i);
  	  edge e;
  	  tail = b->end;
! 	  if (b->next_bb == EXIT_BLOCK_PTR
! 	      || GET_CODE (b->next_bb->head) == CODE_LABEL)
  	    break;
  	  for (e = b->succ; e; e = e->succ_next)
  	    if ((e->flags & EDGE_FALLTHRU) != 0)
Index: ssa-dce.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ssa-dce.c,v
retrieving revision 1.15
diff -c -3 -p -r1.15 ssa-dce.c
*** ssa-dce.c	17 May 2002 02:31:55 -0000	1.15
--- ssa-dce.c	20 May 2002 00:45:15 -0000
*************** find_control_dependence (el, edge_index,
*** 247,253 ****
      abort ();
    ending_block =
      (INDEX_EDGE_PRED_BB (el, edge_index) == ENTRY_BLOCK_PTR)
!     ? BASIC_BLOCK (0)
      : find_pdom (pdom, INDEX_EDGE_PRED_BB (el, edge_index));
  
    for (current_block = INDEX_EDGE_SUCC_BB (el, edge_index);
--- 247,253 ----
      abort ();
    ending_block =
      (INDEX_EDGE_PRED_BB (el, edge_index) == ENTRY_BLOCK_PTR)
!     ? ENTRY_BLOCK_PTR->next_bb
      : find_pdom (pdom, INDEX_EDGE_PRED_BB (el, edge_index));
  
    for (current_block = INDEX_EDGE_SUCC_BB (el, edge_index);
*************** find_pdom (pdom, block)
*** 275,281 ****
      abort ();
  
    if (block == ENTRY_BLOCK_PTR)
!     return BASIC_BLOCK (0);
    else if (block == EXIT_BLOCK_PTR || pdom[block->index] == EXIT_BLOCK)
      return EXIT_BLOCK_PTR;
    else
--- 275,281 ----
      abort ();
  
    if (block == ENTRY_BLOCK_PTR)
!     return ENTRY_BLOCK_PTR->next_bb;
    else if (block == EXIT_BLOCK_PTR || pdom[block->index] == EXIT_BLOCK)
      return EXIT_BLOCK_PTR;
    else


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