]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-iterator.c (append_to_statement_list_1): Handle case that *list_p is not a STMT_...
authorTom de Vries <tom@codesourcery.com>
Tue, 17 Apr 2012 18:28:34 +0000 (18:28 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Tue, 17 Apr 2012 18:28:34 +0000 (18:28 +0000)
2012-04-17  Tom de Vries  <tom@codesourcery.com>

* tree-iterator.c (append_to_statement_list_1): Handle case that *list_p
is not a STMT_LIST.

From-SVN: r186545

gcc/ChangeLog
gcc/tree-iterator.c

index 05a4925b2c3b1136d55c80cb3c37c75455721819..c82e892ab3b73a60bd30fa92cb16aefafa8150ab 100644 (file)
@@ -1,3 +1,8 @@
+2012-04-17  Tom de Vries  <tom@codesourcery.com>
+
+       * tree-iterator.c (append_to_statement_list_1): Handle case that *list_p
+       is not a STMT_LIST.
+
 2012-04-17  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/53020
index 44b6bed7ad8bb97f367eecb4f98ec8acb3f0e7bb..e4175fd46eca9ee3e1f7969296c535d97a559922 100644 (file)
@@ -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);