https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93483
--- Comment #3 from anlauf at gcc dot gnu.org ---
The case
program p
print *, +[ real :: +(1) ]
end
is solved by e.g.
diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c
index c4c1041afdf..b2fbeddeb49 100644
--- a/gcc/fortran/arith.c
+++ b/gcc/fortran/arith.c
@@ -1268,6 +1268,11 @@ reduce_unary (arith (*eval) (gfc_expr *, gfc_expr **),
gfc_expr *op,
head = gfc_constructor_copy (op->value.constructor);
for (c = gfc_constructor_first (head); c; c = gfc_constructor_next (c))
{
+ if (c->expr->expr_type == EXPR_FUNCTION
+ && c->expr->value.function.isym
+ && c->expr->value.function.isym->elemental)
+ gfc_simplify_expr (c->expr, 1);
+
rc = reduce_unary (eval, c->expr, &r);
if (rc != ARITH_OK)
Another case of missed simplification?