]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree.c (nreverse): Assert that we don't have a BLOCK.
authorNathan Froyd <froydnj@codesourcery.com>
Mon, 9 Aug 2010 14:36:50 +0000 (14:36 +0000)
committerNathan Froyd <froydnj@gcc.gnu.org>
Mon, 9 Aug 2010 14:36:50 +0000 (14:36 +0000)
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
gcc/ada/ChangeLog
gcc/ada/gcc-interface/utils.c
gcc/tree.c

index 013683ff5a327acb0c241af59060db7fb848a4a9..6c73664e85d370fbb3f23767aaf7b86551949120 100644 (file)
@@ -1,3 +1,7 @@
+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.
index 34248250db33e2c48c298c98578e67eda09c34f3..1b4e752bcb24bc9f7ade7f36eb1f04585ada70e1 100644 (file)
@@ -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.
index 5edcbfeb9994dcb834342b71ab005006d2a0965d..e1f4bbc18e54072e5a1047541b9ac2ed64086ec3 100644 (file)
@@ -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
index f40114575e88e72310569f778f7267a79ba642d4..e67a00cae6aaa78abd1b3a23ee24b76550444fe6 100644 (file)
@@ -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;