[all-commits] [llvm/llvm-project] 8f3357: [flang][runtime] Don't use -1 in I/O API for "defa...

Peter Klausler via All-commits all-commits at lists.llvm.org
Tue Jan 2 09:44:30 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8f3357b75b6f0093e3e5df8adb140c9dad24f881
      https://github.com/llvm/llvm-project/commit/8f3357b75b6f0093e3e5df8adb140c9dad24f881
  Author: Peter Klausler <35819229+klausler at users.noreply.github.com>
  Date:   2024-01-02 (Tue, 02 Jan 2024)

  Changed paths:
    M flang/include/flang/Runtime/io-api.h
    M flang/include/flang/Runtime/magic-numbers.h
    M flang/lib/Lower/IO.cpp
    M flang/module/iso_fortran_env.f90
    M flang/runtime/io-api.cpp
    M flang/runtime/unit.cpp
    M flang/test/Lower/HLFIR/calls-f77.f90
    M flang/test/Lower/HLFIR/convert-mbox-to-value.f90
    M flang/test/Lower/OpenMP/FIR/parallel-lastprivate-clause-scalar.f90
    M flang/test/Lower/OpenMP/parallel-lastprivate-clause-scalar.f90
    M flang/test/Lower/array-character.f90
    M flang/test/Lower/array-expression-slice-1.f90
    M flang/test/Lower/array-expression.f90
    M flang/test/Lower/array-temp.f90
    M flang/test/Lower/host-associated.f90
    M flang/test/Lower/io-statement-2.f90
    M flang/test/Lower/vector-subscript-io.f90

  Log Message:
  -----------
  [flang][runtime] Don't use -1 in I/O API for "default unit" (#76642)

The I/O runtime's API allows -1 to be passed for a unit number in a
READ, WRITE, or PRINT statement, where it gets replaced by 5 or 6 as
appropriate. This turns out to have been a bad idea, as it prevents the
I/O runtime from detecting and reporting a program's invalid attempt to
use -1 as an I/O unit number. So just pass 5 or 6 as appropriate.




More information about the All-commits mailing list