[gcc r16-9338] a68: add assert after calling a68_lower_tree on a unit list

"Jose E. Marchesi via Gcc-cvs" <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:7f0d5036a7c832b0a9417343774950c9abc65890

commit r16-9338-g7f0d5036a7c832b0a9417343774950c9abc65890
Author: Jose E. Marchesi <[email protected]>
Date:   Sat Jun 13 17:53:33 2026 +0200

    a68: add assert after calling a68_lower_tree on a unit list
    
    Signed-off-by: Jose E. Marchesi <[email protected]>
    
    gcc/algol68/ChangeLog
    
            * a68-low-clauses.cc (a68_lower_collateral_clause): Check that
            a68_lower_tree on the units list return NULL_TREE.
    
    (cherry picked from commit 0d997fc5535adccb673333b7a47ba4a676324e45)

Diff:
---
 gcc/algol68/a68-low-clauses.cc | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gcc/algol68/a68-low-clauses.cc b/gcc/algol68/a68-low-clauses.cc
index 9fca4b872bc8..fb77f964770a 100644
--- a/gcc/algol68/a68-low-clauses.cc
+++ b/gcc/algol68/a68-low-clauses.cc
@@ -1072,7 +1072,12 @@ a68_lower_collateral_clause (NODE_T *p ATTRIBUTE_UNUSED,
   /* Lower the constituent units into a statements list.  */
   a68_push_stmt_list (mode);
   if (!clause_is_empty)
-    (void) a68_lower_tree (NEXT (SUB (p)), ctx);
+    {
+      if (a68_lower_tree (NEXT (SUB (p)), ctx) != NULL_TREE)
+	/* unit lists always lower to NULL_TREE and, as a side-effect,
+	   append the units to the current statements list.  */
+	gcc_unreachable ();
+    }
   tree units = a68_pop_stmt_list ();
 
   /* The collateral clause lowers to different constructions depending on its
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.