[PATCH] D91278: [Clang][CodeGen][RISCV] Fix hard float ABI for struct with empty struct and complex
Luís Marques via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 11 09:31:21 PST 2020
luismarques created this revision.
luismarques added reviewers: asb, lenary, rjmccall, efriedma.
Herald added subscribers: cfe-commits, frasercrmck, NickHung, evandro, apazos, sameer.abuasal, pzheng, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar.
Herald added a project: clang.
luismarques requested review of this revision.
Fixes bug 44904.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D91278
Files:
clang/lib/CodeGen/TargetInfo.cpp
clang/test/CodeGen/riscv32-ilp32d-abi.cpp
Index: clang/test/CodeGen/riscv32-ilp32d-abi.cpp
===================================================================
--- clang/test/CodeGen/riscv32-ilp32d-abi.cpp
+++ clang/test/CodeGen/riscv32-ilp32d-abi.cpp
@@ -32,3 +32,11 @@
double f_empty_double_float(empty_double_float a) {
return a.g;
}
+
+struct empty_complex { struct {}; double _Complex fc; };
+
+// CHECK: define double @_Z20f_empty_double_float13empty_complex(double %0, double %1)
+// CHECK: { [8 x i8], double, double }
+double f_empty_double_float(empty_complex a) {
+ return __imag__ a.fc;
+}
Index: clang/lib/CodeGen/TargetInfo.cpp
===================================================================
--- clang/lib/CodeGen/TargetInfo.cpp
+++ clang/lib/CodeGen/TargetInfo.cpp
@@ -10479,7 +10479,6 @@
return false;
Field1Ty = CGT.ConvertType(EltTy);
Field1Off = CurOff;
- assert(CurOff.isZero() && "Unexpected offset for first field");
Field2Ty = Field1Ty;
Field2Off = Field1Off + getContext().getTypeSizeInChars(EltTy);
return true;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91278.304551.patch
Type: text/x-patch
Size: 1043 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201111/25be2d61/attachment.bin>
More information about the cfe-commits
mailing list