https://llvm.org/bugs/show_bug.cgi?id=30219
Bug ID: 30219
Summary: [OpenCL 2.0] Wrong implicit cast from pipe built-in
functions.
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: OpenCL
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
Here is an example that exposes the issue:
__kernel void testKernel(__global int *status, write_only pipe int tested_pipe)
{
*status = 0;
int value = 2;
if (write_pipe(tested_pipe, &value)) { *status = 2; return; }
}
Error message I get in Release mode on the trunk:
Branch condition is not 'i1' type!
br i32 %5, label %6, label %8
%5 = call i32 @__write_pipe_2(%opencl.pipe_t addrspace(1)* %3, i8
addrspace(4)* %4, i32 4, i32 4)
fatal error: error in backend: Broken function found, compilation aborted!
In Debug mode clang crashes in
clang::CodeGen::CodeGenFunction::EmitBranchOnBoolExpr function.
It looks like a bug in the parser. Here is the expression passed to that
function:
CallExpr 0x7aed540 '_Bool'
|-ImplicitCastExpr 0x7aed528 'int (*)()' <BuiltinFnToFnPtr>
| `-DeclRefExpr 0x7aed438 '<builtin fn type>' Function 0x7aed358 'write_pipe'
'int ()'
|-DeclRefExpr 0x7aed460 'pipe int' lvalue ParmVar 0x7aecfe0 'tested_pipe' 'pipe
int'
`-UnaryOperator 0x7aed4d8 'int *' prefix '&'
`-DeclRefExpr 0x7aed488 'int' lvalue Var 0x7aed298 'value' 'int'
This looks wrong. There should be built-in call and implicit cast of resulting
integer to boolean value.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs