[patches] Re: more robust find_sub_basic_blocks

Jan Hubicka jh@suse.cz
Tue Jul 24 15:19:00 GMT 2001


> On Tue, Jul 24, 2001 at 11:55:10PM +0200, Jan Hubicka wrote:
> > Should solve the problems on Alpha too, solves sparc testcase I do have.
> 
> Which test case?
Just an combine.c file that was causing verify_flow_info to complain
about control flow inside BB.
I've seen equivalent alpha bugreport about reload1 too.
> 
> > +      We can't simply drop the BARRIER off the existing BB, as we want
> > +      to call make_edges on the newly created jump insn.  It is most
> > +      likely return insn created by eh_return splitter.  */
> > +   if (GET_CODE (bb->end) == BARRIER)
> 
> Explain this bit some more.  That we want to call make_edges
> would appear to bear no relation to whether or not we place 
> the barrier after the end of the block that we split.
Uhm yes, now when I call make_edges for all.

I am just testing modification of the patch:
OK if it succeeds?

St čec 25 00:43:18 CEST 2001  Jan Hubicka  <jh@suse.cz>
	* flow.c (find_sub_basic_blocks): Fix handling of the last BB in
	  sequence.

*** egcs/gcc/flow.c	Tue Jul 24 22:52:45 2001
--- flow.c	Wed Jul 25 00:17:46 2001
*************** find_sub_basic_blocks (bb)
*** 710,717 ****
    rtx insn = bb->head;
    rtx end = bb->end;
    rtx jump_insn = NULL_RTX;
-   int created = 0;
-   int barrier = 0;
    edge falltru = 0;
    basic_block first_bb = bb;
  
--- 709,714 ----
*************** find_sub_basic_blocks (bb)
*** 730,736 ****
  	case BARRIER:
  	  if (!jump_insn)
  	    abort ();
- 	  barrier = 1;
  	  break;
  	/* On code label, split current basic block.  */
  	case CODE_LABEL:
--- 727,732 ----
*************** find_sub_basic_blocks (bb)
*** 739,747 ****
  	    bb->end = jump_insn;
  	  bb = falltru->dest;
  	  remove_edge (falltru);
- 	  barrier = 0;
  	  jump_insn = 0;
- 	  created = 1;
  	  if (LABEL_ALTERNATE_NAME (insn))
  	    make_edge (NULL, ENTRY_BLOCK_PTR, bb, 0);
  	  break;
--- 735,741 ----
*************** find_sub_basic_blocks (bb)
*** 774,783 ****
        insn = NEXT_INSN (insn);
      }
  
!   /* In case we've got barrier at the end of new insn stream, put it
!      outside basic block.  */
!   if (GET_CODE (bb->end) == BARRIER)
!     bb->end = PREV_INSN (bb->end);
  
    /* We've possibly replaced the conditional jump by conditional jump
       followed by cleanup at fallthru edge, so the outgoing edges may
--- 768,778 ----
        insn = NEXT_INSN (insn);
      }
  
!   /* In case expander replaced normal insn by sequence terminating by
!      return and barrier, or possibly other sequence not behaving like
!      ordinary jump, we need to take care and move basic block boundary.  */
!   if (jump_insn && GET_CODE (bb->end) != JUMP_INSN)
!     bb->end = jump_insn;
  
    /* We've possibly replaced the conditional jump by conditional jump
       followed by cleanup at fallthru edge, so the outgoing edges may
*************** find_sub_basic_blocks (bb)
*** 786,792 ****
  
    /* Now re-scan and wire in all edges.  This expect simple (conditional)
       jumps at the end of each new basic blocks.  */
!   make_edges (NULL, first_bb->index, bb->index - 1);
  }
  
  /* Find all basic blocks of the function whose first insn is F.
--- 781,787 ----
  
    /* Now re-scan and wire in all edges.  This expect simple (conditional)
       jumps at the end of each new basic blocks.  */
!   make_edges (NULL, first_bb->index, bb->index);
  }
  
  /* Find all basic blocks of the function whose first insn is F.



More information about the Gcc-patches mailing list