From 72ac05b04e2baf2ff9eebd42e6ff5f22fd3b1546 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Mon, 9 Aug 2010 14:36:50 +0000 Subject: [PATCH] tree.c (nreverse): Assert that we don't have a BLOCK. gcc/ * tree.c (nreverse): Assert that we don't have a BLOCK. gcc/ada/ * gcc-interface/utils.c (gnat_poplevel): Use blocks_nreverse. From-SVN: r163036 --- gcc/ChangeLog | 4 ++++ gcc/ada/ChangeLog | 4 ++++ gcc/ada/gcc-interface/utils.c | 2 +- gcc/tree.c | 3 +++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 013683ff5a3..6c73664e85d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2010-08-09 Nathan Froyd + + * tree.c (nreverse): Assert that we don't have a BLOCK. + 2010-08-09 Nathan Froyd * builtins.c (fold_builtin_next_arg): Use stdarg_p. diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 34248250db3..1b4e752bcb2 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,7 @@ +2010-08-09 Nathan Froyd + + * gcc-interface/utils.c (gnat_poplevel): Use blocks_nreverse. + 2010-08-09 Eric Botcazou * gcc-interface/utils.c (build_vms_descriptor32): Fix formatting. diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 5edcbfeb999..e1f4bbc18e5 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -382,7 +382,7 @@ gnat_poplevel (void) tree block = level->block; BLOCK_VARS (block) = nreverse (BLOCK_VARS (block)); - BLOCK_SUBBLOCKS (block) = nreverse (BLOCK_SUBBLOCKS (block)); + BLOCK_SUBBLOCKS (block) = blocks_nreverse (BLOCK_SUBBLOCKS (block)); /* If this is a function-level BLOCK don't do anything. Otherwise, if there are no variables free the block and merge its subblocks into those of its diff --git a/gcc/tree.c b/gcc/tree.c index f40114575e8..e67a00cae6a 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -2108,6 +2108,9 @@ nreverse (tree t) tree prev = 0, decl, next; for (decl = t; decl; decl = next) { + /* We shouldn't be using this function to reverse BLOCK chains; we + have blocks_nreverse for that. */ + gcc_checking_assert (TREE_CODE (decl) != BLOCK); next = TREE_CHAIN (decl); TREE_CHAIN (decl) = prev; prev = decl;