[llvm-bugs] [Bug 47142] New: -fasynchronous-unwind-tables fails to produce unwind information for epilogues

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Aug 12 10:47:32 PDT 2020


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

            Bug ID: 47142
           Summary: -fasynchronous-unwind-tables fails to produce unwind
                    information for epilogues
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: wittman at chromium.org
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

Specifying -fasynchronous-unwind-tables doesn't emit sufficient unwind
information to unwind from function epilogues. In the repro case below the
compiler should be producing unwind information for addresses 0x24 and 0x28 to
account for the changes to sp in the previous instructions, but this is not
happening. Unwinds from those addresses will not work properly as a result.

This was observed in Chromium's clang built from
1bd7046e4ce0102adef6096a12a289d7f94b8c73.

test.cc:
void foo(int a, int b, int c, int d, int e, int f) {}

$ clang -target arm-linux-androideabi16 -g -funwind-tables
-fasynchronous-unwind-tables -fomit-frame-pointer -c test.cc -o test.o

$ objdump -j .text -dC test.o

test.o:     file format elf32-littlearm


Disassembly of section .text:

00000000 <foo(int, int, int, int, int, int)>:
   0:   e92d4800        push    {fp, lr}
   4:   e24dd010        sub     sp, sp, #16
   8:   e59dc01c        ldr     ip, [sp, #28]
   c:   e59de018        ldr     lr, [sp, #24]
  10:   e58d000c        str     r0, [sp, #12]
  14:   e58d1008        str     r1, [sp, #8]
  18:   e58d2004        str     r2, [sp, #4]
  1c:   e58d3000        str     r3, [sp]
  20:   e28dd010        add     sp, sp, #16
  24:   e8bd4800        pop     {fp, lr}
  28:   e12fff1e        bx      lr

$ dwarfdump --debug-frame test.o
test.o: file format ELF32-arm-little

.debug_frame contents:

00000000 00000010 ffffffff CIE
  Version:               4
  Augmentation:          ""
  Address size:          4
  Segment desc size:     0
  Code alignment factor: 1
  Data alignment factor: -4
  Return address column: 14

  DW_CFA_def_cfa: reg13 +0
  DW_CFA_nop:
  DW_CFA_nop:

00000014 00000018 00000000 FDE cie=00000000 pc=00000000...0000002c
  DW_CFA_advance_loc: 4
  DW_CFA_def_cfa_offset: +8
  DW_CFA_offset: reg14 -4
  DW_CFA_offset: reg11 -8
  DW_CFA_advance_loc: 4
  DW_CFA_def_cfa_offset: +24
  DW_CFA_nop:
  DW_CFA_nop:


.eh_frame contents:

-- 
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/20200812/2b166c1c/attachment.html>


More information about the llvm-bugs mailing list