https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99711
--- Comment #13 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
Looking at the -fdump-tree-originals in the two cases:
The working case:
{.elem_len=10, .rank=1, .type=6});
The failing case:
D.3962 = (sizetype) NON_LVALUE_EXPR <.cbulist_ru>;
.....
{.elem_len=(unsigned long) SAVE_EXPR <D.3962>, .rank=1, .type=6});
Also one sees this:
Breakpoint 1, _gfortran_st_set_nml_var (dtp=0x7fffffffd2a0, var_addr=0x408910,
var_name=0x402053 "cbulist_ru", len=1, string_length=10, dtype=...)
at ../../../trunk/libgfortran/io/transfer.c:4597
4597 {
(gdb) p *dtype
Structure has no component named operator*.
(gdb) p dtype
$1 = {elem_len = 14971996835529359360, version = 0, rank = 1 '\001',
type = 6 '\006', attribute = 0}
The call to _gfortran_st_set_nml_var is created by the frontend as shown in the
dump, the elem_len is bogus.
As far as I can tell then, the front-end is failing in the allocation
initializing the size correctly.