@@ -788,6 +788,8 @@ struct TargetX86_64Win : public GenericTarget<TargetX86_64Win> {
788788// ===----------------------------------------------------------------------===//
789789
790790namespace {
791+ // AArch64 procedure call standard:
792+ // https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#parameter-passing
791793struct TargetAArch64 : public GenericTarget <TargetAArch64> {
792794 using GenericTarget::GenericTarget;
793795
@@ -917,6 +919,8 @@ struct TargetAArch64 : public GenericTarget<TargetAArch64> {
917919 .Case <fir::LogicalType>([&](auto ) { return NRegs{1 , false }; })
918920 .Case <fir::CharacterType>([&](auto ) { return NRegs{1 , false }; })
919921 .Case <fir::SequenceType>([&](auto ty) {
922+ assert (ty.getShape ().size () == 1 &&
923+ " invalid array dimensions in BIND(C)" );
920924 NRegs nregs = usedRegsForType (loc, ty.getEleTy ());
921925 nregs.n *= ty.getShape ()[0 ];
922926 return nregs;
@@ -970,8 +974,6 @@ struct TargetAArch64 : public GenericTarget<TargetAArch64> {
970974 return marshal;
971975 }
972976
973- // AArch64 procedure call ABI:
974- // https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#parameter-passing
975977 CodeGenSpecifics::Marshalling
976978 structType (mlir::Location loc, fir::RecordType type, bool isResult) const {
977979 NRegs nregs = usedRegsForRecordType (loc, type);
0 commit comments