[llvm-bugs] [Bug 41157] New: [C++] Incorrect generation of initializers for __local addr space class variables in IR

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 20 11:48:09 PDT 2019


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

            Bug ID: 41157
           Summary: [C++] Incorrect generation of initializers for __local
                    addr space class variables in IR
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: OpenCL
          Assignee: unassignedclangbugs at nondot.org
          Reporter: anastasia.stulova at arm.com
                CC: anastasia.stulova at arm.com, llvm-bugs at lists.llvm.org

OpenCL spec s6.5.2 disallows initializers on __local addr space variables, but
even when they are not initialized in the source clang adds initializers for
the class type variables in IR.

Example:

  1 class C{
  2 int i;
  3 };
  4 
  5 kernel void test()
  6 {
  7   __local int i;
  8   __local C ii;
  9 }


Produces in IR:


@_ZZ4testvE1i = internal addrspace(3) global i32 undef, align 4
@_ZZ4testvE2ii = internal addrspace(3) global %class.C zeroinitializer, align 4

-- 
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/20190320/9af5d15e/attachment-0001.html>


More information about the llvm-bugs mailing list