[llvm-bugs] [Bug 42408] New: Incorrect unwind tables when saving high register on Thumb1 target

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jun 26 06:30:26 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=42408

            Bug ID: 42408
           Summary: Incorrect unwind tables when saving high register on
                    Thumb1 target
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: ARM
          Assignee: unassignedbugs at nondot.org
          Reporter: oliver.stannard at arm.com
                CC: llvm-bugs at lists.llvm.org, peter.smith at linaro.org,
                    Ties.Stuij at arm.com

For Thumb1-only targets (e.g. Armv6M) we emit incorrect unwind tables when
saving high registers (which aren't normally allocatable, but can be usind in
inline assembly):

  // test.cpp
  extern void foo();
  void bar() {
    asm("" : : : "r8");
    foo();
  }

  $ clang   --target=arm-arm-none-eabi -march=armv6-m -c test.cpp -Os -o - -S
  ...
 _Z3barv:
         .fnstart
  @ %bb.0:                                @ %entry
         .save   {lr}
         push    {lr}
         mov     lr, r8
         push    {lr}
         @APP
         @NO_APP
         bl      _Z3foov
         pop     {r0}
         mov     r8, r0
         pop     {pc}
   .Lfunc_end0:
         .size   _Z3barv, .Lfunc_end0-_Z3barv
         .fnend
  ...

This means that debuggers and the C++ exception unwinder won't be able to
unwind through functions like this.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190626/4a6c32f6/attachment.html>


More information about the llvm-bugs mailing list