@@ -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
@@ -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;