================
@@ -80,13 +80,47 @@ ARMBaseRegisterInfo::getCalleeSavedRegs(const 
MachineFunction *MF) const {
                                        ? CSR_ATPCS_SplitPush_SwiftTail_SaveList
                                        : CSR_AAPCS_SwiftTail_SaveList);
   } else if (F.hasFnAttribute("interrupt")) {
+
+    // Don't bother saving the floating point registers if target is not hard
+    // float. This will prevent the Thumb1FrameLowering (cortex-m0) from
+    // crashing due to an llvm_unreachable being triggered when a D-class
+    // register is in the calling convention.
+    if (STI.isTargetHardFloat() && F.hasFnAttribute("save-fp")) {
----------------
pestctrl wrote:

How about we check for if if the subtarget has FP registers? 

```
if (STI.hasFPRegs() && F.hasFnAttribute("save-fp"))
```

https://github.com/llvm/llvm-project/pull/89654
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to