https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97860
--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
I was going to commit the following but I'll leave it to you.
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index d348e39c27a..95cf9e4cb00 100644
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -5775,6 +5775,10 @@ get_parm_array_spec (const struct c_parm *parm, tree
attrs)
type = TREE_TYPE (type))
{
tree nelts = array_type_nelts (type);
+ if (error_operand_p (nelts))
+ /* Avoid erroneous expressions. */
+ return attrs;
+
if (TREE_CODE (nelts) != INTEGER_CST)
{
/* Each variable VLA bound is represented by the dollar