public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/61628] New: A program that reads from a file with stream access and uses pack() suddenly stops
@ 2014-06-27 10:49 arjen.markus895 at gmail dot com
  2014-06-27 17:40 ` [Bug fortran/61628] " jvdelisle at gcc dot gnu.org
                   ` (18 more replies)
  0 siblings, 19 replies; 20+ messages in thread
From: arjen.markus895 at gmail dot com @ 2014-06-27 10:49 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61628
           Summary: A program that reads from a file with stream access
                    and uses pack() suddenly stops
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: arjen.markus895 at gmail dot com

Created attachment 33016
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33016&action=edit
Example data file as used in the program, compressed

The following program suddenly stops after the statement with pack() -- without
any message -- but it continues if you comment out the read statement:

! readprint.f90 --
!     Read and print some data from a binary file
!
program readprint
    implicit none

    integer                            :: noseg, nx, ny, dummy, i
    integer, dimension(:), allocatable :: matrix

    open( 10, file = 'binary_data', form = 'unformatted', access = 'stream' )
    read( 10 ) nx, ny, (dummy, i = 1,4)

    allocate( matrix(nx*ny) )

!
! If the READ statement is commented, then the program continues, otherwise
! it stops without any message
!
    read( 10 ) matrix
    write(*,*) nx, ny, size(matrix)
    write(*,*) pack( matrix, matrix /= 1 )
    write(*,*) matrix(1:1000)
    write(*,*) 'done'

end program readprint

I have not tried this on another data file, but the behaviour is odd enough
that I want to report this.

Note: gfortran -v gives:

Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.8.1/configure --prefix=/mingw --host=mingw32
--build=mingw32 --without-pic --enable-shared --enable-static --with-gnu-ld
--enable-lto --enable-libssp --disable-multilib
--enable-languages=c,c++,fortran,objc,obj-c++,ada --disable-sjlj-exceptions
--with-dwarf2 --disable-win32-registry --enable-libstdcxx-debug
--enable-version-specific-runtime-libs
--with-gmp=/usr/src/pkg/gmp-5.1.2-1-mingw32-src/bld
--with-mpc=/usr/src/pkg/mpc-1.0.1-1-mingw32-src/bld --with-mpfr=
--with-system-zlib --with-gnu-as --enable-decimal-float=yes --enable-libgomp
--enable-threads --with-libiconv-prefix=/mingw32 --with-libintl-prefix=/mingw
--disable-bootstrap LDFLAGS=-s CFLAGS=-D_USE_32BIT_TIME_T
Thread model: win32
gcc version 4.8.1 (GCC)


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2015-02-12  0:40 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-27 10:49 [Bug fortran/61628] New: A program that reads from a file with stream access and uses pack() suddenly stops arjen.markus895 at gmail dot com
2014-06-27 17:40 ` [Bug fortran/61628] " jvdelisle at gcc dot gnu.org
2014-06-27 17:50 ` dominiq at lps dot ens.fr
2014-06-29 14:39 ` jvdelisle at gcc dot gnu.org
2014-06-29 18:08 ` arjen.markus895 at gmail dot com
2014-06-29 21:28 ` jvdelisle at gcc dot gnu.org
2014-07-01  1:58 ` jvdelisle at gcc dot gnu.org
2014-07-01  7:37 ` arjen.markus895 at gmail dot com
2014-07-01 10:53 ` dominiq at lps dot ens.fr
2014-07-01 10:59 ` dominiq at lps dot ens.fr
2014-07-01 11:35 ` arjen.markus895 at gmail dot com
2014-07-02  1:17 ` jvdelisle at gcc dot gnu.org
2014-07-02  1:55 ` jvdelisle at gcc dot gnu.org
2014-07-02  6:48 ` arjen.markus895 at gmail dot com
2014-07-02 15:03 ` jvdelisle at gcc dot gnu.org
2014-07-03  6:18 ` arjen.markus895 at gmail dot com
2014-07-03 13:33 ` [Bug fortran/61628] [MinGW)Write of medium sized or larger matrix fails without error message jvdelisle at gcc dot gnu.org
2014-07-03 16:52 ` burnus at gcc dot gnu.org
2014-07-12 19:06 ` burnus at gcc dot gnu.org
2015-02-12  0:40 ` jvdelisle at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).