https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124616
--- Comment #7 from Steve Kargl <kargl at gcc dot gnu.org> ---
It seems the cobol frontend is not expecting iconv_open to fail.
% gdb151 ~/work/x/libexec/gcc/x86_64-unknown-freebsd16.0/16.0.1/cobol1
(gdb) b
/home/kargl/gcc/gcc/libstdc++-v3/libsupc++/../../libgcobol/charmaps.h:353
Breakpoint 1 at 0xb50f80: file
/home/kargl/gcc/gcc/libstdc++-v3/libsupc++/../../libgcobol/charmaps.h, line
353.
(gdb) run check_88.cob
Breakpoint 1, charmap_t::charmap_t (this=0x804b32fc0, e=<optimized out>)
at
/home/kargl/gcc/gcc/libstdc++-v3/libsupc++/../../libgcobol/charmaps.h:353
353 /*size_t nret = */ iconv( cd,
(gdb) p cd
$1 = (libiconv_t) 0x804af6f00
(gdb) c
Continuing.
Breakpoint 1, charmap_t::charmap_t (this=0x804b31f80, e=<optimized out>)
at
/home/kargl/gcc/gcc/libstdc++-v3/libsupc++/../../libgcobol/charmaps.h:353
353 /*size_t nret = */ iconv( cd,
(gdb) p cd
$3 = (libiconv_t) 0xffffffffffffffff
(gdb) p (int64_t)cd
$5 = -1
%man iconv_open
...
RETURN VALUE
The iconv_open function returns a freshly allocated conversion
descriptor. In case of error, it sets errno and returns (iconv_t)(-1).