https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93483
--- Comment #21 from anlauf at gcc dot gnu.org --- (In reply to Mikael Morin from comment #17) > Like this for the first part of the test from the patch: > > diff --git a/gcc/fortran/arith.cc b/gcc/fortran/arith.cc > index 9e079e42995..5e96bb9658e 100644 > --- a/gcc/fortran/arith.cc > +++ b/gcc/fortran/arith.cc > @@ -1267,6 +1267,9 @@ reduce_unary (arith (*eval) (gfc_expr *, gfc_expr **), > gfc_expr *op, > if (op->expr_type == EXPR_CONSTANT) > return eval (op, result); > > + if (op->expr_type != EXPR_ARRAY) > + return ARITH_INVALID_TYPE; > + > rc = ARITH_OK; > head = gfc_constructor_copy (op->value.constructor); > for (c = gfc_constructor_first (head); c; c = gfc_constructor_next (c)) > > Yeah, I was getting just rather close to this one... This is probably the right way to go.