https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87673
--- Comment #4 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- Running f951 under valgrind, we get with current trunk (r269549): ==27666== Memcheck, a memory error detector ==27666== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==27666== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info ==27666== Command: /home/ig25/lib/gcc/x86_64-pc-linux-gnu/9.0.1/f951 big.f90 ==27666== ==27666== Conditional jump or move depends on uninitialised value(s) ==27666== at 0x84A598: gfc_match_decl_type_spec(gfc_typespec*, int) (decl.c:4047) ==27666== by 0x84BA2C: gfc_match_data_decl() (decl.c:5950) ==27666== by 0x8AA8D0: match_word (parse.c:65) ==27666== by 0x8AA8D0: decode_statement() (parse.c:376) ==27666== by 0x8AE374: next_free (parse.c:1241) ==27666== by 0x8AE374: next_statement() (parse.c:1473) ==27666== by 0x8B04A4: parse_spec(gfc_statement) (parse.c:3681) ==27666== by 0x8B220C: parse_progunit(gfc_statement) (parse.c:5680) ==27666== by 0x8B25AD: parse_contained(int) (parse.c:5581) ==27666== by 0x8B329E: parse_module() (parse.c:5953) ==27666== by 0x8B36EB: gfc_parse_file() (parse.c:6256) ==27666== by 0x8FCDCF: gfc_be_parse_file() (f95-lang.c:204) ==27666== by 0xE2234F: compile_file() (toplev.c:456) ==27666== by 0x81F907: do_compile (toplev.c:2204) ==27666== by 0x81F907: toplev::main(int, char**) (toplev.c:2339) ==27666== ==27666== Invalid read of size 1 ==27666== at 0x8BC9DE: resolve_elemental_actual(gfc_expr*, gfc_code*) (resolve.c:2160) ==27666== by 0x8CC2B2: resolve_function (resolve.c:3228) ==27666== by 0x8CC2B2: gfc_resolve_expr(gfc_expr*) (resolve.c:6866) ==27666== by 0x8CFACB: resolve_charlen(gfc_charlen*) [clone .part.0] (resolve.c:11943) ==27666== by 0x8C09A8: resolve_charlen (resolve.c:11934) ==27666== by 0x8C09A8: resolve_types(gfc_namespace*) (resolve.c:16727) ==27666== by 0x8C0A63: resolve_types(gfc_namespace*) (resolve.c:16740) ==27666== by 0x8C5DDC: gfc_resolve(gfc_namespace*) [clone .part.0] (resolve.c:16843) ==27666== by 0x8B3706: gfc_parse_file() (parse.c:6275) ==27666== by 0x8FCDCF: gfc_be_parse_file() (f95-lang.c:204) ==27666== by 0xE2234F: compile_file() (toplev.c:456) ==27666== by 0x81F907: do_compile (toplev.c:2204) ==27666== by 0x81F907: toplev::main(int, char**) (toplev.c:2339) ==27666== by 0x8233BE: main (main.c:39) [...] so I suspect that this is where the problem comes from.