https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83225
--- Comment #4 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> --- Author: jvdelisle Date: Sun Dec 3 05:05:51 2017 New Revision: 255364 URL: https://gcc.gnu.org/viewcvs?rev=255364&root=gcc&view=rev Log: 2017-12-02 Jerry DeLisle <jvdeli...@gcc.gnu.org> Backport from trunk PR libgfortran/83225 * io/io.h (is_internal_unit): Use the unit_is_internal bit. * io/transfer.c (data_transfer_init): Set the bit to true for internal units. Use that bit for checks for internal unit initializations. * io/unit.c (insert_unit): As a precaution, set the internal_unit_kind to zero when a unit structure is first created. Modified: branches/gcc-7-branch/libgfortran/ChangeLog branches/gcc-7-branch/libgfortran/io/io.h branches/gcc-7-branch/libgfortran/io/transfer.c branches/gcc-7-branch/libgfortran/io/unit.c