]> git.ipfire.org Git - thirdparty/gcc.git/commit
OpenMP/Fortran: Fix allocatable-component mapping of derived-type array comps
authorTobias Burnus <tburnus@baylibre.com>
Thu, 15 May 2025 07:15:21 +0000 (09:15 +0200)
committerTobias Burnus <tburnus@baylibre.com>
Thu, 15 May 2025 07:15:21 +0000 (09:15 +0200)
commitf99017c3125f4400cf6a098cf5b33d32fe3e6645
tree8f02aaa3c03af52f39538318086832a7daa82817
parentd010a39b9e788a1b3c58e0954c1b2c6afad8210a
OpenMP/Fortran: Fix allocatable-component mapping of derived-type array comps

The check whether the location expression in map clause has allocatable
components was failing for some derived-type array expressions such as
  map(var%tiles(1))
as the compiler produced
  _4 = var.tiles;
  MEMREF(_4, _5);
This commit now also handles this case.

gcc/fortran/ChangeLog:

* trans-openmp.cc (gfc_omp_deep_mapping_do): Handle SSA_NAME if
a def_stmt is available.

libgomp/ChangeLog:

* testsuite/libgomp.fortran/alloc-comp-4.f90: New test.
gcc/fortran/trans-openmp.cc
libgomp/testsuite/libgomp.fortran/alloc-comp-4.f90 [new file with mode: 0644]