https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64770
Bug ID: 64770 Summary: [5 Regression] Segmentation fault when opening a file with status="new" and the file exists. Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libfortran Assignee: unassigned at gcc dot gnu.org Reporter: dominiq at lps dot ens.fr CC: jb at gcc dot gnu.org, jvdelisle at gcc dot gnu.org Executing the code implicit none open(99, file="test.dat", access="stream", form="unformatted", status="new") close(99) end should give At line 3 of file eof_4_red.f90 (unit = 99, file = '') Fortran runtime error: File 'test.dat' already exists if the file "test.dat" exists. This is the case for 4.9 and 5.0 up to revision r215301 (2014-09-16). However from r215328 (2014-09-17) up to r220065, running the test gives Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: #0 0x10547d6c2 #1 0x10547c9e0 #2 0x7fff97f89f19 Segmentation fault The culprit is likely r215307. Note that I stumbled on this PR for gfortran.dg/eof_4.f90 while regtesting with -j8.