@@ -788,6 +788,8 @@ struct TargetX86_64Win : public GenericTarget<TargetX86_64Win> {
788
788
// ===----------------------------------------------------------------------===//
789
789
790
790
namespace {
791
+ // AArch64 procedure call standard:
792
+ // https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#parameter-passing
791
793
struct TargetAArch64 : public GenericTarget <TargetAArch64> {
792
794
using GenericTarget::GenericTarget;
793
795
@@ -917,6 +919,8 @@ struct TargetAArch64 : public GenericTarget<TargetAArch64> {
917
919
.Case <fir::LogicalType>([&](auto ) { return NRegs{1 , false }; })
918
920
.Case <fir::CharacterType>([&](auto ) { return NRegs{1 , false }; })
919
921
.Case <fir::SequenceType>([&](auto ty) {
922
+ assert (ty.getShape ().size () == 1 &&
923
+ " invalid array dimensions in BIND(C)" );
920
924
NRegs nregs = usedRegsForType (loc, ty.getEleTy ());
921
925
nregs.n *= ty.getShape ()[0 ];
922
926
return nregs;
@@ -970,8 +974,6 @@ struct TargetAArch64 : public GenericTarget<TargetAArch64> {
970
974
return marshal;
971
975
}
972
976
973
- // AArch64 procedure call ABI:
974
- // https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#parameter-passing
975
977
CodeGenSpecifics::Marshalling
976
978
structType (mlir::Location loc, fir::RecordType type, bool isResult) const {
977
979
NRegs nregs = usedRegsForRecordType (loc, type);
0 commit comments