summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2012-11-06 23:55:29 +0000
committerRichard Henderson <rth@gcc.gnu.org>2012-11-06 15:55:29 -0800
commit066b83541dbfbf39b6f0521cd2e5338cbb4c3e78 (patch)
tree018b54568181c78fdd2b8bdfe4d27ca85060f16a
parent27f7e1c331267244a7dbace1f38192f98ef8fad0 (diff)
downloadgcc-066b83541dbfbf39b6f0521cd2e5338cbb4c3e78.tar.gz
* cfghooks.c (copy_bbs): Handle a null loop_father.
From-SVN: r193270
-rw-r--r--gcc/ChangeLog2
-rw-r--r--gcc/cfghooks.c15
2 files changed, 11 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1cde0fa59a4..e85aed0302a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c
index d54dd469cf4..39f2f93d9be 100644
--- a/gcc/cfghooks.c
+++ b/gcc/cfghooks.c
@@ -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. */