From a60596b8e5f844177a4abbb0f02b0575d3c4b1cb Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Tue, 17 Apr 2012 18:28:34 +0000 Subject: [PATCH] tree-iterator.c (append_to_statement_list_1): Handle case that *list_p is not a STMT_LIST. 2012-04-17 Tom de Vries * tree-iterator.c (append_to_statement_list_1): Handle case that *list_p is not a STMT_LIST. From-SVN: r186545 --- gcc/ChangeLog | 5 +++++ gcc/tree-iterator.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 05a4925b2c3..c82e892ab3b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2012-04-17 Tom de Vries + + * tree-iterator.c (append_to_statement_list_1): Handle case that *list_p + is not a STMT_LIST. + 2012-04-17 Uros Bizjak PR target/53020 diff --git a/gcc/tree-iterator.c b/gcc/tree-iterator.c index 44b6bed7ad8..e4175fd46ec 100644 --- a/gcc/tree-iterator.c +++ b/gcc/tree-iterator.c @@ -74,6 +74,13 @@ append_to_statement_list_1 (tree t, tree *list_p) } *list_p = list = alloc_stmt_list (); } + else if (TREE_CODE (list) != STATEMENT_LIST) + { + tree first = list; + *list_p = list = alloc_stmt_list (); + i = tsi_last (list); + tsi_link_after (&i, first, TSI_CONTINUE_LINKING); + } i = tsi_last (list); tsi_link_after (&i, t, TSI_CONTINUE_LINKING);