aboutsummaryrefslogtreecommitdiff
path: root/gcc/d/toir.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/d/toir.cc')
-rw-r--r--gcc/d/toir.cc26
1 files changed, 24 insertions, 2 deletions
diff --git a/gcc/d/toir.cc b/gcc/d/toir.cc
index e5f5751..e387f27 100644
--- a/gcc/d/toir.cc
+++ b/gcc/d/toir.cc
@@ -529,6 +529,28 @@ public:
this->do_label (label);
}
+ /* Generate and set a new continue label for the current unrolled loop. */
+
+ void push_unrolled_continue_label (UnrolledLoopStatement *s)
+ {
+ this->push_continue_label (s);
+ }
+
+ /* Finish with the continue label for the unrolled loop. */
+
+ void pop_unrolled_continue_label (UnrolledLoopStatement *s)
+ {
+ Statement *stmt = s->getRelatedLabeled ();
+ d_label_entry *ent = d_function_chain->labels->get (stmt);
+ gcc_assert (ent != NULL && ent->bc_label == true);
+
+ this->pop_continue_label (TREE_VEC_ELT (ent->label, bc_continue));
+
+ /* Remove the continue label from the label htab, as a new one must be
+ inserted at the end of every unrolled loop. */
+ ent->label = TREE_VEC_ELT (ent->label, bc_break);
+ }
+
/* Visitor interfaces. */
@@ -1089,9 +1111,9 @@ public:
if (statement != NULL)
{
- tree lcontinue = this->push_continue_label (statement);
+ this->push_unrolled_continue_label (s);
this->build_stmt (statement);
- this->pop_continue_label (lcontinue);
+ this->pop_unrolled_continue_label (s);
}
}