[all-commits] [llvm/llvm-project] 3f6dbf: [flang] Don't close stderr in runtime (fixes STOP ...

Peter Klausler via All-commits all-commits at lists.llvm.org
Wed Dec 1 13:25:34 PST 2021

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3f6dbf1a75b259e242116820aec040b4b72d9296
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2021-12-01 (Wed, 01 Dec 2021)

  Changed paths:
    M flang/runtime/file.cpp
    M flang/runtime/file.h

  Log Message:
  [flang] Don't close stderr in runtime (fixes STOP output)

STOP statement output was sometimes failing to appear because
the runtime flushes and shuts down open Fortran units beforehand.
But when file descriptor 2 was closed, the STOP statement output
was suppressed.  The fix is to not actually close file descriptors
0-2 if they are connected to Fortran units being closed.  This was
already the policy when an OPEN statement was (re-)opening such a
unit, so that logic has been pulled out into a member function and
shared with CLOSE processing.

Differential Revision: https://reviews.llvm.org/D114897

More information about the All-commits mailing list