[all-commits] [llvm/llvm-project] daa182: [Flang][OpenMP] Fix copyin allocatable lowering to...

Kaviya Rajendiran via All-commits all-commits at lists.llvm.org
Wed Jan 22 21:44:21 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: daa18205c6f0a3b5dd62ba2e65948e1a9182a60f
      https://github.com/llvm/llvm-project/commit/daa18205c6f0a3b5dd62ba2e65948e1a9182a60f
  Author: Kaviya Rajendiran <67495422+kaviya2510 at users.noreply.github.com>
  Date:   2025-01-23 (Thu, 23 Jan 2025)

  Changed paths:
    M flang/lib/Lower/Bridge.cpp
    M flang/test/Lower/OpenMP/copyin.f90

  Log Message:
  -----------
  [Flang][OpenMP] Fix copyin allocatable lowering to MLIR (#122097)

Fixes https://github.com/llvm/llvm-project/issues/113191

Issue: [flang][OpenMP] Runtime segfault when an allocatable variable is
used with copyin

Rootcause: The value of the threadprivate variable is not being copied
from the primary thread to the other threads within a parallel region.
As a result it tries to access a null pointer inside a parallel region
which causes segfault.

Fix: When allocatables used with copyin clause need to ensure that, on
entry to any parallel region each threadโ€™s copy of a variable will
acquire the allocation status of the primary thread, before copying the
value of a threadprivate variable of the primary thread to the
threadprivate variable of each other member of the team.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list