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.
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. */