[OPENMP]Fix PR49636: Assertion `(!Entry.getAddress() || Entry.getAddress() == Addr...
authorAlexey Bataev <a.bataev@outlook.com>
Wed, 24 Mar 2021 20:21:43 +0000 (13:21 -0700)
committerAlexey Bataev <a.bataev@outlook.com>
Mon, 29 Mar 2021 13:55:57 +0000 (06:55 -0700)
commitf6f21dcd6c2fa8e44d8c466c5db190aef42beef2
tree3246deada713dce4dcb59f1ff52e088d6aed1347
parent0858f0e09e33f62fc1dcc45e0bdec47eee1e23ba
[OPENMP]Fix PR49636: Assertion `(!Entry.getAddress() || Entry.getAddress() == Addr) && "Resetting with the new address."' failed.

The original issue is caused by the fact that the variable is allocated
with incorrect type i1 instead of i8. This causes the bitcasting of the
declaration to i8 type and the bitcast expression does not match the
original variable.
To fix the problem, the UndefValue initializer and the original
variable should be emitted with type i8, not i1.

Differential Revision: https://reviews.llvm.org/D99297
clang/lib/CodeGen/CodeGenModule.cpp
clang/test/OpenMP/declare_target_codegen.cpp