[PATCH] D24228: [Thumb] Save/restore high registers in Thumb1 pro/epilogues

Tim Northover via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 28 02:47:36 PDT 2016


t.p.northover added inline comments.

================
Comment at: lib/Target/ARM/Thumb1FrameLowering.cpp:654-656
@@ -596,1 +653,5 @@
+    } else {
+      // FIXME: This gets hit when using SjLj exceptions, as
+      // ARM::Int_eh_sjlj_dispatchsetup clobbers the FP registers.
+      //llvm_unreachable("callee-saved register of unexpected class");
     }
----------------
Ouch, that's pretty evil. As far as I can tell the intrinsic is recording the fact that the exception could have come from virtually anywhere, including an ARM function that's clobbered everything.

But clearly that hasn't worked in the past either so I'd prefer making that an explicit ABI contract: we can change the regmask set in ARMISelLowering.cpp to reflect that d8-d15 must be preserved by whatever means rather than letting the frame lowering continue to do something that's clearly wrong.

Realistically, no-one is going to come along and ask us to support SjLj exceptions for Thumb1-only code that uses VFP regs any more anyway (Xcode hasn't been able to target it since 2012 as far as I can tell); a FrameLowering sanity-check is more important.


Repository:
  rL LLVM

https://reviews.llvm.org/D24228





More information about the llvm-commits mailing list