[patch] for gomp breakage

Zdenek Dvorak rakdver@atrey.karlin.mff.cuni.cz
Fri Apr 27 21:42:00 GMT 2007


Hello,

this problem is in move_block_to_fn; last_basic_block is
set to the number of the last basic block, but it should be
by one higher (this field of the cfg struct is somewhat misnamed).

We also keep the moved block in the dominance info for the
original function, which currently does not cause problems, but
it might later.

OK once it passes testing?

Zdenek

	* tree-cfg.c (move_block_to_fn): Release bb from dominance
	info.  Update last_basic_block correctly.

Index: tree-cfg.c
===================================================================
*** tree-cfg.c	(revision 124235)
--- tree-cfg.c	(working copy)
*************** move_block_to_fn (struct function *dest_
*** 4571,4576 ****
--- 4571,4579 ----
    struct move_stmt_d d;
    unsigned old_len, new_len;
  
+   /* Remove BB from dominance structures.  */
+   delete_from_dominance_info (CDI_DOMINATORS, bb);
+ 
    /* Link BB to the new linked list.  */
    move_block_after (bb, after);
  
*************** move_block_to_fn (struct function *dest_
*** 4589,4596 ****
    /* Grow DEST_CFUN's basic block array if needed.  */
    cfg = dest_cfun->cfg;
    cfg->x_n_basic_blocks++;
!   if (bb->index > cfg->x_last_basic_block)
!     cfg->x_last_basic_block = bb->index;
  
    old_len = VEC_length (basic_block, cfg->x_basic_block_info);
    if ((unsigned) cfg->x_last_basic_block >= old_len)
--- 4592,4599 ----
    /* Grow DEST_CFUN's basic block array if needed.  */
    cfg = dest_cfun->cfg;
    cfg->x_n_basic_blocks++;
!   if (bb->index >= cfg->x_last_basic_block)
!     cfg->x_last_basic_block = bb->index + 1;
  
    old_len = VEC_length (basic_block, cfg->x_basic_block_info);
    if ((unsigned) cfg->x_last_basic_block >= old_len)



More information about the Gcc-patches mailing list