[all-commits] [llvm/llvm-project] a56f37: [flang][Lower] get ultimate symbol when querying i...

Tom Eccles via All-commits all-commits at lists.llvm.org
Fri Jul 19 11:01:48 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a56f37d3bc46f711a1bb8eda6839eb51d1af7d11
      https://github.com/llvm/llvm-project/commit/a56f37d3bc46f711a1bb8eda6839eb51d1af7d11
  Author: Tom Eccles <tom.eccles at arm.com>
  Date:   2024-07-19 (Fri, 19 Jul 2024)

  Changed paths:
    M flang/lib/Lower/Allocatable.cpp
    A flang/test/Lower/OpenMP/firstprivate-allocatable.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-allocatable-array-minmax.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-allocatable.f90

  Log Message:
  -----------
  [flang][Lower] get ultimate symbol when querying if pointer or allocatable (#99528)

This fixes a bug in OpenMP privatisation. The privatised variables are
created as though they are host associated clones of the original
variables. These privatised variables do not contain the allocatable
attribute themselves and so we need to check if the ultimate symbol is
allocatable. Having or not having this flag influences whether lowering
determines that this is a whole allocatable assignment, which then
causes hlfir.assign not to get the realloc flag, which cases the
allocatable not to be allocated when it is assigned to (leading to a
segfault running the newly added test).

I also did the same for pointer variables because I would imagine they
could experience the same issue.

There is no fallout on tests outside of OpenMP, and the gfortran test
suite still passes, so I think this doesn't break host other kinds of
host associated symbols.



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