* cfghooks.c (copy_bbs): Handle a null loop_father.

From-SVN: r193270
This commit is contained in:
Aldy Hernandez 2012-11-06 23:55:29 +00:00 committed by Richard Henderson
parent 27f7e1c331
commit 066b83541d
2 changed files with 11 additions and 6 deletions

View file

@ -1,5 +1,7 @@
2012-11-06 Aldy Hernandez <aldyh@redhat.com>
* cfghooks.c (copy_bbs): Handle a null loop_father.
* cgraph.c (cgraph_debug_gimple_stmt): Handle a null
current_function_decl.

View file

@ -1258,12 +1258,15 @@ copy_bbs (basic_block *bbs, unsigned n, basic_block *new_bbs,
new_bb = new_bbs[i] = duplicate_block (bb, NULL, after);
after = new_bb;
bb->flags |= BB_DUPLICATED;
/* Possibly set loop header. */
if (bb->loop_father->header == bb && bb->loop_father != base)
new_bb->loop_father->header = new_bb;
/* Or latch. */
if (bb->loop_father->latch == bb && bb->loop_father != base)
new_bb->loop_father->latch = new_bb;
if (bb->loop_father)
{
/* Possibly set loop header. */
if (bb->loop_father->header == bb && bb->loop_father != base)
new_bb->loop_father->header = new_bb;
/* Or latch. */
if (bb->loop_father->latch == bb && bb->loop_father != base)
new_bb->loop_father->latch = new_bb;
}
}
/* Set dominators. */