[all-commits] [llvm/llvm-project] 9dc327: [OPENMP]Fix PR46688: cast the type of the allocate...

Alexey Bataev via All-commits all-commits at lists.llvm.org
Wed Jul 15 11:55:17 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 9dc327d1b74637dac6dc432fb66f88711af16a55
      https://github.com/llvm/llvm-project/commit/9dc327d1b74637dac6dc432fb66f88711af16a55
  Author: Alexey Bataev <a.bataev at hotmail.com>
  Date:   2020-07-15 (Wed, 15 Jul 2020)

  Changed paths:
    M clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
    M clang/test/OpenMP/nvptx_allocate_codegen.cpp

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

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.

Reviewers: jdoerfert

Subscribers: jholewinski, cfe-commits, yaxunl, guansong, caomhin

Tags: #clang

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




More information about the All-commits mailing list