<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - -fasynchronous-unwind-tables fails to produce unwind information for epilogues"
   href="https://bugs.llvm.org/show_bug.cgi?id=47142">47142</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>-fasynchronous-unwind-tables fails to produce unwind information for epilogues
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>wittman@chromium.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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:</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>