================
@@ -1244,16 +1244,26 @@ void CIRGenFunction::emitAggregateCopy(LValue dest, 
LValue src, QualType ty,
 
   assert(!cir::MissingFeatures::aggValueSlotVolatile());
 
-  // NOTE(cir): original codegen would normally convert destPtr and srcPtr to
-  // i8* since memcpy operates on bytes. We don't need that in CIR because
-  // cir.copy will operate on any CIR pointer that points to a sized type.
-
   // Don't do any of the memmove_collectable tests if GC isn't set.
   if (cgm.getLangOpts().getGC() != LangOptions::NonGC)
     cgm.errorNYI("emitAggregateCopy: GC");
 
-  [[maybe_unused]] cir::CopyOp copyOp =
-      builder.createCopy(destPtr.getPointer(), srcPtr.getPointer(), 
isVolatile);
+  // If the data size (excluding tail padding) differs from the full type size,
+  // we can't use cir.copy (which always copies the full pointee type). 
Instead,
----------------
xlauko wrote:

@erichkeane what do you think now?

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

Reply via email to