[OPENMP]Use the real pointer value as base, not indexed value.
authorAlexey Bataev <a.bataev@hotmail.com>
Thu, 19 Nov 2020 17:16:25 +0000 (09:16 -0800)
committerAlexey Bataev <a.bataev@hotmail.com>
Fri, 20 Nov 2020 19:34:14 +0000 (11:34 -0800)
commitc964f308141578f24932c68a03af5fae7f876011
tree1ceb17b0c71f640a8ac8a0bd3e041750b6363304
parent77e25b5bc8860e23395f617dcca4940489f6355c
[OPENMP]Use the real pointer value as base, not indexed value.

After fix for PR48174 the base pointer for pointer-based
array-sections/array-subscripts will be emitted as `&ptr[idx]`, but
actually it should be just `ptr`, i.e. the address stored in the ponter
to point correctly to the beginning of the array. Currently it may lead
to a crash in the runtime.

Differential Revision: https://reviews.llvm.org/D91805
clang/lib/CodeGen/CGOpenMPRuntime.cpp
clang/test/OpenMP/target_data_map_pointer_array_subscript_codegen.cpp