[Bug fortran/80945] Invalid code with allocatable character array in READ/WRITE statement

tkoenig at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jun 1 19:56:00 GMT 2017


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

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-06-01
     Ever confirmed|0                           |1

--- Comment #2 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
The dtype is messed up.  Breaking at _gfortran_transfer_array
for the test case in cmment #1 shows

Breakpoint 1, _gfortran_transfer_array (dtp=0x7fffffffd910,
desc=0x7fffffffdaf0, kind=1, charlen=10) at
../../../gcc-7/libgfortran/io/transfer.c:2409
2409      if ((dtp->common.flags & IOPARM_LIBRETURN_MASK) !=
IOPARM_LIBRETURN_OK)
(gdb) p *desc
$3 = {base_addr = 0x605ff0 "foo       bar       xyzzy     ", offset =
18446744073709551615, dtype = 689, dim = {{_stride = 1, lower_bound = 1,
_ubound = 3}, {_stride = 8241976683187367782, 
      lower_bound = 2340036147838197792, _ubound = 2314885530818453536},
{_stride = 2314885530818453536, lower_bound = 2314885530818453536, _ubound =
2314885530818453536}, {_stride = 8224, 
      lower_bound = 44024187392, _ubound = 140737488346016}, {_stride = 0,
lower_bound = 4196368, _ubound = 140737488346240}, {_stride = 140737488346016,
lower_bound = 4197718, 
      _ubound = 140737488346248}, {_stride = 4294967296, lower_bound = 4197728,
_ubound = 140737336403265}}}
(gdb) c
Continuing.
foo  bar  xyzzy

Breakpoint 1, _gfortran_transfer_array (dtp=0x7fffffffd910,
desc=0x7fffffffd8e0, kind=1, charlen=10) at
../../../gcc-7/libgfortran/io/transfer.c:2409
2409      if ((dtp->common.flags & IOPARM_LIBRETURN_MASK) !=
IOPARM_LIBRETURN_OK)
(gdb) p *desc
$4 = {base_addr = 0x605ff0 "foo       bar       xyzzy     ", offset = 0, dtype
= -60931979599, dim = {{_stride = 1, lower_bound = 1, _ubound = 3}, {_stride =
25769807872, lower_bound = 4198108, 
      _ubound = 13}, {_stride = 0, lower_bound = 0, _ubound = 0}, {_stride = 0,
lower_bound = 0, _ubound = 0}, {_stride = 4198114, lower_bound = 5, _ubound =
0}, {_stride = 0, lower_bound = 0, 
      _ubound = 0}, {_stride = 0, lower_bound = 0, _ubound = 0}}}


More information about the Gcc-bugs mailing list