https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93483
--- Comment #18 from Mikael Morin <mikael at gcc dot gnu.org> --- (In reply to Mikael Morin from comment #17) > And something similar for the rest of the test (the binary operators). Like this: diff --git a/gcc/fortran/arith.cc b/gcc/fortran/arith.cc index 5e96bb9658e..3fdda045227 100644 --- a/gcc/fortran/arith.cc +++ b/gcc/fortran/arith.cc @@ -1318,7 +1318,7 @@ reduce_binary_ac (arith (*eval) (gfc_expr *, gfc_expr *, gfc_expr **), if (c->expr->expr_type == EXPR_CONSTANT) rc = eval (c->expr, op2, &r); - else if (c->expr->expr_type == EXPR_OP && c->expr->ts.type == BT_UNKNOWN) + else if (c->expr->expr_type != EXPR_ARRAY) rc = ARITH_INVALID_TYPE; else rc = reduce_binary_ac (eval, c->expr, op2, &r); @@ -1372,7 +1372,7 @@ reduce_binary_ca (arith (*eval) (gfc_expr *, gfc_expr *, gfc_expr **), if (c->expr->expr_type == EXPR_CONSTANT) rc = eval (op1, c->expr, &r); - else if (c->expr->expr_type == EXPR_OP && c->expr->ts.type == BT_UNKNOWN) + else if (c->expr->expr_type != EXPR_ARRAY) rc = ARITH_INVALID_TYPE; else rc = reduce_binary_ca (eval, op1, c->expr, &r); @@ -1433,8 +1433,8 @@ reduce_binary_aa (arith (*eval) (gfc_expr *, gfc_expr *, gfc_expr **), c && d; c = gfc_constructor_next (c), d = gfc_constructor_next (d)) { - if ((c->expr->expr_type == EXPR_OP && c->expr->ts.type == BT_UNKNOWN) - || (d->expr->expr_type == EXPR_OP && d->expr->ts.type == BT_UNKNOWN)) + if ((c->expr->expr_type != EXPR_ARRAY) + || (d->expr->expr_type != EXPR_ARRAY)) rc = ARITH_INVALID_TYPE; else rc = reduce_binary (eval, c->expr, d->expr, &r);