This is an archive of the discontinued LLVM Phabricator instance.

[OPENMP]Fix PR46688: cast the type of the allocated variable to the initial one.
ClosedPublic

Authored by ABataev on Jul 13 2020, 10:14 AM.

Details

Summary

If the original variable is marked for allocation in the different
address space using #pragma omp allocate, need to cast the allocated
variable to its original type with the original address space.
Otherwise, the compiler may crash trying to bitcast the type of the new
allocated variable to the original type in some cases, like passing this
variable as an argument in function calls.

Diff Detail

Event Timeline

ABataev created this revision.Jul 13 2020, 10:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2020, 10:14 AM
jdoerfert accepted this revision.Jul 15 2020, 7:38 AM

LGTM. We might need to pick this for 11.

This revision is now accepted and ready to land.Jul 15 2020, 7:38 AM

LGTM. We might need to pick this for 11.

Yes, just like the fix for user-defined reduction from https://reviews.llvm.org/D83334

This revision was automatically updated to reflect the committed changes.