https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105813
anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |anlauf at gcc dot gnu.org --- Comment #2 from anlauf at gcc dot gnu.org --- Simpler fix: diff --git a/gcc/fortran/check.cc b/gcc/fortran/check.cc index 0c2cb50c6a7..91d87a1b2c1 100644 --- a/gcc/fortran/check.cc +++ b/gcc/fortran/check.cc @@ -6353,6 +6353,8 @@ gfc_check_unpack (gfc_expr *vector, gfc_expr *mask, gfc_expr *field) if (!same_type_check (vector, 0, field, 2)) return false; + gfc_simplify_expr (mask, 0); + if (mask->expr_type == EXPR_ARRAY && gfc_array_size (vector, &vector_size)) {