summaryrefslogtreecommitdiff
path: root/gcc/tree-iterator.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-iterator.c')
-rw-r--r--gcc/tree-iterator.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/tree-iterator.c b/gcc/tree-iterator.c
index 7913bdad7c8..3c2acd38ea7 100644
--- a/gcc/tree-iterator.c
+++ b/gcc/tree-iterator.c
@@ -110,8 +110,11 @@ tsi_link_before (tree_stmt_iterator *i, tree t, enum tsi_iterator_update mode)
}
else
{
- gcc_assert (!STATEMENT_LIST_TAIL (i->container));
- STATEMENT_LIST_HEAD (i->container) = head;
+ head->prev = STATEMENT_LIST_TAIL (i->container);
+ if (head->prev)
+ head->prev->next = head;
+ else
+ STATEMENT_LIST_HEAD (i->container) = head;
STATEMENT_LIST_TAIL (i->container) = tail;
}
@@ -127,7 +130,6 @@ tsi_link_before (tree_stmt_iterator *i, tree t, enum tsi_iterator_update mode)
i->ptr = tail;
break;
case TSI_SAME_STMT:
- gcc_assert (cur);
break;
}
}