<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [C++] Incorrect generation of initializers for __local addr space class variables in IR"
   href="https://bugs.llvm.org/show_bug.cgi?id=41157">41157</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[C++] Incorrect generation of initializers for __local addr space class variables in IR
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>OpenCL
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>anastasia.stulova@arm.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>anastasia.stulova@arm.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>