Skip to content

[flang] Runtime failure with stream formatted I/O #149164

@DanielCChen

Description

@DanielCChen

Consider the following code

program main
use ieee_arithmetic

    complex(4), pointer :: cx1(:,:), cx2(:)
    character(:), allocatable :: string

10  format(dc, 12(" (", e22.15, " ; ", e22.15, " );"))

    open (1, file='valueSeparator005.data', access='stream', form='formatted')

    string = repeat(' ', 800)

    allocate (cx1(2,5))

    cx1 = cmplx(reshape((/(i, i=-10,-1)/), (/2,5/)), &
        reshape((/(i**2, i=-10,-1)/), (/2,5/)), 4)

    write (string, 10) cx1

    !! now read in data from both external and internal files
    allocate (cx2(10))

    read (string, *, decimal='coMMA') cx2
end

Flang failed at the runtime with

> a.out

fatal Fortran runtime error(t.f:23): Bad real input data at column 51 of record 1
IOT/Abort trap(coredump)

All ifort, gfortran and XLF compile and execute the program successfully.

Metadata

Metadata

Assignees

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions