[llvm-bugs] [Bug 41567] New: Failure casting from __generic to __global address space when variable is volatile

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Apr 23 07:06:07 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=41567

            Bug ID: 41567
           Summary: Failure casting from __generic to __global address
                    space when variable is volatile
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: OpenCL
          Assignee: unassignedclangbugs at nondot.org
          Reporter: drohr at jwdt.org
                CC: anastasia.stulova at arm.com, llvm-bugs at lists.llvm.org

Created attachment 21815
  --> https://bugs.llvm.org/attachment.cgi?id=21815&action=edit
Failing test case

The attached test_case (test_fail.cl) attempts to cast a volatile int* to
__global volatile int*, it fails compilation with clang 9 (commit
4b56b8f9df9d7fe4ee69f56fc4726910a4a72b04) with the following error message:

test_fail.cl:3:50: error: internal error: could not emit constant value
"abstractly"
    atomic_add((__global volatile unsigned int*) a, 1);

The modified test case (test_work.cl), which only has the volatile keyword
removed, works.

Command line is: clang++ -cl-std=c++ -x cl -cl-denorms-are-zero -cl-mad-enable
-cl-no-signed-zeros -Xclang -finclude-default-header -c test_fail.cl -o test.o

Background: Following the discussion on
https://bugs.llvm.org/show_bug.cgi?id=40778, I changed my code to have
different functions for old-style atomic operations on __global and __local
address space. During that process, I came across this issue.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190423/949b28a6/attachment.html>


More information about the llvm-bugs mailing list