https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99688
anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |anlauf at gcc dot gnu.org --- Comment #1 from anlauf at gcc dot gnu.org --- I do not see the issue with valgrind, but does the following obvious patch help? diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index 4d5890fd523..9941887453f 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -6634,7 +6634,7 @@ gfc_match_select_rank (void) { gfc_expr *expr1, *expr2 = NULL; match m; - char name[GFC_MAX_SYMBOL_LEN]; + char name[GFC_MAX_SYMBOL_LEN + 1]; gfc_symbol *sym, *sym2; gfc_namespace *ns = gfc_current_ns; gfc_array_spec *as = NULL; There might be a similar issue with SELECT TYPE (gfc_match_select_type).