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

Oliver Stannard via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 26 05:34:58 PDT 2016


olista01 marked an inline comment as done.

================
Comment at: lib/Target/ARM/Thumb1FrameLowering.cpp:641-643
@@ +640,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");
+    }
----------------
t.p.northover wrote:
> Stale comment? Certainly a scary one.
The comment is accurate, these unreachables are hit by existing regression tests. The code before this patch doesn't check this at all, and emits nonsense instructions like this:
  push    {d8, d9, d10, d11, d12, d13, d14, d15, r8, r10, r11, r4, r5, r6, r7, lr}
for test/CodeGen/ARM/eh-dispcont.ll and test/CodeGen/ARM/global-merge.ll when targeting a thumb1-only iOS target.

This patch (with the unreachables commented out) sort-of fixes this by not adding the D registers to the GPR push/pop instructions.

I know next-to nothing about SjLj handling, Is it the case that this intrinsic shouldn't clobber the FP regs, or does it actually change them (meaning it can't be supported on Thumb1-only targets without switching to ARM mode if available)?


https://reviews.llvm.org/D24228





More information about the llvm-commits mailing list