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]

fix basic_block_for_insn in commit_edge_insertions



Hi,
the basic_block_for_insn is bogus in some instances of commit_edge_insertions,
that can cause make_edges called by find_sub_basic_blocks to fail.

This patch should solve it.

Bootstrapped/regtested i686

St čec 25 00:38:55 CEST 2001  Jan Hubicka  <jh@suse.cz>
	* flow.c (block_label): Update basic_block_for_insn.
	(commit_edge_insertions): Call compute_bb_for_insn.

*** flow.c.old	Tue Jul 24 17:13:33 2001
--- flow.c	Wed Jul 25 00:33:10 2001
*************** block_label (block)
*** 1591,1597 ****
    if (block == EXIT_BLOCK_PTR)
      return NULL_RTX;
    if (GET_CODE (block->head) != CODE_LABEL)
!     block->head = emit_label_before (gen_label_rtx (), block->head);
    return block->head;
  }
  
--- 1605,1615 ----
    if (block == EXIT_BLOCK_PTR)
      return NULL_RTX;
    if (GET_CODE (block->head) != CODE_LABEL)
!     {
!       block->head = emit_label_before (gen_label_rtx (), block->head);
!       if (basic_block_for_insn)
! 	set_block_for_insn (block->head, block);
!     }
    return block->head;
  }
  
*************** commit_edge_insertions ()
*** 2292,2297 ****
--- 2277,2283 ----
  {
    int i;
    basic_block bb;
+   compute_bb_for_insn (get_max_uid ());
  
  #ifdef ENABLE_CHECKING
    verify_flow_info ();


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