I believe the attached program is legal, it works with my HP compiler, and the basic premise of the test, write without doing an open, comes from a SPEC test. On ia64-hp-hpux11.20, I get a core dump and putting in the open makes things work. I assume other platforms will show the same behaviour. My debugger croaks on the testcase so I don't know if I can track down the specific problem.
Test Case: integer ijk C open(unit=90) write(90,iostat=ierro) ijk end -- Summary: write with no open causes core dump Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: sje at cup dot hp dot com CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: ia64-hp-hpux11.20 GCC host triplet: ia64-hp-hpux11.20 GCC target triplet: ia64-hp-hpux11.20 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18891