https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127892

--- Comment #3 from Harald Anlauf <anlauf at gcc dot gnu.org> ---
Even simpler:

module m
  character(8), parameter :: c8 = transfer('AB', 'xxxxxxxx')
  character(*), parameter :: cc = c8(8:8)
end module

==873320== Invalid read of size 2
==873320==    at 0x5895A90: memmove (vg_replace_strmem.c:1429)
==873320==    by 0x1063C4E: gfc_simplify_expr(gfc_expr*, int) (expr.cc:2533)
==873320==    by 0x1065B6C: gfc_check_init_expr(gfc_expr*) (expr.cc:3412)
==873320==    by 0x1065CC6: gfc_reduce_init_expr(gfc_expr*) (expr.cc:3469)
==873320==    by 0x1065DC1: gfc_match_init_expr(gfc_expr**) (expr.cc:3515)
==873320==    by 0x1037BED: variable_decl(int) (decl.cc:3272)
==873320==    by 0x103FA81: gfc_match_data_decl() (decl.cc:7076)
==873320==    by 0x1105BBA: match_word(char const*, match (*)(), locus*, bool,
bool) (parse.cc:105)
==873320==    by 0x1106BD8: decode_statement() (parse.cc:471)
==873320==    by 0x110FF09: next_free() (parse.cc:1718)
==873320==    by 0x111049C: next_statement() (parse.cc:1951)
==873320==    by 0x1117027: parse_spec(gfc_statement) (parse.cc:4671)

Reply via email to