[PATCH] D22292: [libunwind] Fix unw_getcontext for ARMv6-m

Weiming Zhao via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 18 12:03:43 PDT 2016


weimingz added inline comments.

================
Comment at: src/UnwindRegistersRestore.S:325
@@ -324,4 +324,3 @@
 DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm20restoreCoreAndJumpToEv)
-#if !defined(__ARM_ARCH_ISA_ARM)
-  ldr r2, [r0, #52]
-  ldr r3, [r0, #60]
+#if !defined(__ARM_ARCH_ISA_ARM) && __ARM_ARCH_ISA_THUMB == 1
+  @ r8-r12: ldr into r1-r5, then mov to r8-r12
----------------
originally, r8-r12 were not restored. Was that some existing bug?

================
Comment at: src/UnwindRegistersRestore.S:326
@@ +325,3 @@
+#if !defined(__ARM_ARCH_ISA_ARM) && __ARM_ARCH_ISA_THUMB == 1
+  @ r8-r12: ldr into r1-r5, then mov to r8-r12
+  ldr r1, [r0, #0x20]
----------------
originally, r0-r7 get loaded from [r0]
now, r8-r12 get loaded from [r0+0x20]

is that expected? 



https://reviews.llvm.org/D22292





More information about the cfe-commits mailing list