OSDN Git Service

[OpenMP] Fixed a crash when offloading to x86_64 with target nowait
authorShilei Tian <tianshilei1992@gmail.com>
Wed, 24 Feb 2021 17:37:22 +0000 (12:37 -0500)
committerTom Stellard <tstellar@redhat.com>
Fri, 5 Mar 2021 17:41:50 +0000 (09:41 -0800)
commitd24e102ba2665dc6cd467f467813fba9c8261133
tree87658e6e2805457bc4049820bf5f021a502e32c9
parent52510d84802b55ecd80a904ca259adfecffc5be1
[OpenMP] Fixed a crash when offloading to x86_64 with target nowait

PR#49334 reports a crash when offloading to x86_64 with `target nowait`,
which is caused by referencing a nullptr. The root cause of the issue is, when
pushing a hidden helper task in `__kmp_push_task`, it also maps the gtid to its
shadow gtid, which is wrong.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D97329

(cherry picked from commit e5da63d5a9ede1fb6d8aa18cfd44533ead128738)
openmp/libomptarget/test/offloading/bug49334.cpp [new file with mode: 0644]
openmp/runtime/src/kmp_tasking.cpp