Skip to content

Commit c62373c

Browse files
committed
clang: Do not implicitly addrspacecast in EmitAggExprToLValue
This fixes breaking the ABI for calls to the kernel enqueue implementation functions in OpenCL. The ABI passes these by stack byref or byval, but this was incorrectly casting the stack slot and passing to the use function. I think nearly all uses of CreateMemTemp should not be inserting this cast, but that will require a larger change with many more test updates.
1 parent efb966e commit c62373c

File tree

2 files changed

+21
-31
lines changed

2 files changed

+21
-31
lines changed

clang/lib/CodeGen/CGExprAgg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2219,7 +2219,7 @@ void CodeGenFunction::EmitAggExpr(const Expr *E, AggValueSlot Slot) {
22192219

22202220
LValue CodeGenFunction::EmitAggExprToLValue(const Expr *E) {
22212221
assert(hasAggregateEvaluationKind(E->getType()) && "Invalid argument!");
2222-
Address Temp = CreateMemTemp(E->getType());
2222+
Address Temp = CreateMemTempWithoutCast(E->getType());
22232223
LValue LV = MakeAddrLValue(Temp, E->getType());
22242224
EmitAggExpr(E, AggValueSlot::forLValue(LV, AggValueSlot::IsNotDestructed,
22252225
AggValueSlot::DoesNotNeedGCBarriers,

0 commit comments

Comments
 (0)