================
@@ -286,15 +286,38 @@ void AggExprEmitter::withReturnValueSlot(
   // We need to always provide our own temporary if destruction is required.
   // Otherwise, EmitCall will emit its own, notice that it's "unused", and end
   // its lifetime before we have the chance to emit a proper destructor call.
+  //
+  // We also need a temporary if the destination is in a different address 
space
+  // from the alloca AS, to avoid an invalid addrspacecast on the sret pointer.
+  // Look through addrspacecasts to avoid unnecessary temps when the
+  // destination is already in the alloca AS.
+  unsigned SRetAS = CGF.getContext().getTargetAddressSpace(
+      CGF.CGM.getASTAllocaAddressSpace());
+  bool DestASMismatch = false;
----------------
arsenm wrote:

Can just assign the condition to this instead of conditional assign 

https://github.com/llvm/llvm-project/pull/183639
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to