summaryrefslogtreecommitdiff
path: root/gcc/tree-iterator.c
diff options
context:
space:
mode:
authorbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-13 14:42:16 +0000
committerbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-13 14:42:16 +0000
commit96d249d8f3cf91cbc288ac1e71ec94dcefd136d7 (patch)
tree09057ca2cd80f841761f051ea6eb5f45fb5fa167 /gcc/tree-iterator.c
parenta2d30e46a2a020f82d6865c910025e218802da3d (diff)
downloadgcc-96d249d8f3cf91cbc288ac1e71ec94dcefd136d7.tar.gz
ChangeLog:
2005-07-13 Paolo Bonzini <bonzini@gnu.org> PR tree-optimization/21921 * tree-iterator.c (tsi_link_before): Support the case when tsi_end_p (tsi) == true. testsuite/ChangeLog: 2005-07-13 Paolo Bonzini <bonzini@gnu.org> PR tree-optimization/21921 * gcc.dg/tree-ssa/pr21921.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101970 138bc75d-0d04-0410-961f-82ee72b054a4
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;
}
}