[llvm-bugs] [Bug 36088] New: ExprWithCleanups not handled in emitOpenCLEnqueuedBlock

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 25 08:01:23 PST 2018


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

            Bug ID: 36088
           Summary: ExprWithCleanups not handled in
                    emitOpenCLEnqueuedBlock
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: OpenCL
          Assignee: unassignedclangbugs at nondot.org
          Reporter: llvm at zaghen.it
                CC: llvm-bugs at lists.llvm.org

Created attachment 19749
  --> https://bugs.llvm.org/attachment.cgi?id=19749&action=edit
The CL kernel

The attached source makes clang (6.0-rc1 and trunk) assert on
cast<BlockExpr>().
I tried ignoring the ExprWithCleanups:

   if (auto DR = dyn_cast<DeclRefExpr>(E)) {
     E = cast<VarDecl>(DR->getDecl())->getInit();
   }
+  if (auto Cast = dyn_cast<ExprWithCleanups>(E)) {
+    E = Cast->getSubExpr();
+  }
   if (auto Cast = dyn_cast<CastExpr>(E)) {
     E = Cast->getSubExpr();
   }
   auto *Block = cast<BlockExpr>(E);

but it seems like clang also tries to emit the same block expression twice (the
second time through the OCL enqueue specific codepath.)

Options I used for clang: "-x cl -cl-std=CL2.0 enqueue_block_kernel.cl"

-- 
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/20180125/9132fb7c/attachment.html>


More information about the llvm-bugs mailing list