aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2010-08-09 14:36:50 +0000
committerNathan Froyd <froydnj@gcc.gnu.org>2010-08-09 14:36:50 +0000
commit72ac05b04e2baf2ff9eebd42e6ff5f22fd3b1546 (patch)
treefa6b7dedb01d20440b96360fd716b1a8fdf4f283 /gcc
parentbfc48cd85f90b6d000d2c2c81eb4a6175817f9df (diff)
downloadgcc-72ac05b04e2baf2ff9eebd42e6ff5f22fd3b1546.zip
gcc-72ac05b04e2baf2ff9eebd42e6ff5f22fd3b1546.tar.gz
gcc-72ac05b04e2baf2ff9eebd42e6ff5f22fd3b1546.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/ada/ChangeLog4
-rw-r--r--gcc/ada/gcc-interface/utils.c2
-rw-r--r--gcc/tree.c3
4 files changed, 12 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 013683f..6c73664 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
+ * tree.c (nreverse): Assert that we don't have a BLOCK.
+
+2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
+
* builtins.c (fold_builtin_next_arg): Use stdarg_p.
* config/arm/arm.c (arm_get_pcs_model): Likewise.
* config/avr/avr.c (init_cumulative_args): Likewise.
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 3424825..1b4e752 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,7 @@
+2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
+
+ * gcc-interface/utils.c (gnat_poplevel): Use blocks_nreverse.
+
2010-08-09 Eric Botcazou <ebotcazou@adacore.com>
* 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 5edcbfe..e1f4bbc 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 f401145..e67a00c 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;