This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] for gomp breakage
- From: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- To: Diego Novillo <dnovillo at acm dot org>
- Cc: richard dot guenther at gmail dot com, gcc-patches at gcc dot gnu dot org
- Date: Fri, 27 Apr 2007 23:26:28 +0200
- Subject: [patch] for gomp breakage
- References: <20070427192945.GA6852@atrey.karlin.mff.cuni.cz> <4632515C.1060207@acm.org>
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)