[PATCH] D141690: [clang] fix consteval ctor code generation assert
Luke Nihlen via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 13 06:52:43 PST 2023
luken-google created this revision.
Herald added a project: All.
luken-google requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Fixes GH#53983.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D141690
Files:
clang/lib/CodeGen/CGCall.cpp
Index: clang/lib/CodeGen/CGCall.cpp
===================================================================
--- clang/lib/CodeGen/CGCall.cpp
+++ clang/lib/CodeGen/CGCall.cpp
@@ -1334,7 +1334,8 @@
void CodeGenFunction::EmitAggregateStore(llvm::Value *Val, Address Dest,
bool DestIsVolatile) {
// Prefer scalar stores to first-class aggregate stores.
- if (llvm::StructType *STy = dyn_cast<llvm::StructType>(Val->getType())) {
+ llvm::StructType *STy = dyn_cast<llvm::StructType>(Val->getType());
+ if (STy && STy->isLayoutIdentical(cast<llvm::StructType>(Dest.getElementType()))) {
for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) {
Address EltPtr = Builder.CreateStructGEP(Dest, i);
llvm::Value *Elt = Builder.CreateExtractValue(Val, i);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141690.488989.patch
Type: text/x-patch
Size: 814 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230113/297f7bef/attachment.bin>
More information about the cfe-commits
mailing list