[all-commits] [llvm/llvm-project] 201c9f: [flang][hlfir] Avoid expr buffer reuse when end_as...

Slava Zakharin via All-commits all-commits at lists.llvm.org
Thu Jul 20 10:18:56 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 201c9f87294678ac592f7a56de75bb1a22e968da
      https://github.com/llvm/llvm-project/commit/201c9f87294678ac592f7a56de75bb1a22e968da
  Author: Slava Zakharin <szakharin at nvidia.com>
  Date:   2023-07-20 (Thu, 20 Jul 2023)

  Changed paths:
    M flang/lib/Optimizer/HLFIR/Transforms/BufferizeHLFIR.cpp
    M flang/test/HLFIR/associate-codegen.fir

  Log Message:
  -----------
  [flang][hlfir] Avoid expr buffer reuse when end_associate may cycle.

If end_associate may execute more times than the expr value producer,
then it cannot take ownership of the expr buffer. Otherwise, it may
result in double-free errors.
Note that the LIT test exposes a different issue with fir.alloca
inside the do-loop produced for hlfir.elemental. This may cause
out-of-stack conditions in valid Fortran programs that are not expected
to run out of stack. I will create an issue for this.

Reviewed By: tblah

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




More information about the All-commits mailing list