<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/58493>58493</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            CFI annotations in inline asm with -f[no-]asynchronous-unwind-tables
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          dvyukov
      </td>
    </tr>
</table>

<pre>
    Consider:
```
void foo() {
  asm volatile(".cfi_adjust_cfa_offset 8;");
}

void bar() {
  asm volatile(".cfi_startproc; .cfi_adjust_cfa_offset 8; .cfi_endproc;");
}
```

When compiling with `-fasynchronous-unwind-tables` I am getting:
```
$ clang test.c -c -fasynchronous-unwind-tables
test.c:6:16: error: starting new .cfi frame before finishing the previous one
  asm volatile(".cfi_startproc; .cfi_adjust_cfa_offset 8; .cfi_endproc;");
               ^
```

When compiling with `-fno-asynchronous-unwind-tables` I am getting:
```
$ clang test.c -c -fno-asynchronous-unwind-tables
test.c:2:16: error: this directive must appear between .cfi_startproc and .cfi_endproc directives
  asm volatile(".cfi_adjust_cfa_offset 8;");
               ^
```

So there is no way to write code that would work for both modes.
Clang should either require `.cfi_start/endproc` or not regardless of compilation flags.

`clang version 16.0.0 (https://github.com/llvm/llvm-project.git 5942456a30ea3b71523886d9fa7dc9aa786f5c61)`
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy9VE2PmzAQ_TVwGQUZ8xE4cNiPRuq5hx5XBo_BW2KntiHKv-9AkkZRtatu1TZyzMcbz8x7b5LWylPzZI3XEl2UPUTsOWIPUckua32crZagrI14FfEaou3j-T2A8HuY7SiCHnFFedIp_SLk6-TDS6fEi1XKY4Aqyh4JpePLzbnI9vlycyvSCvfbRXwQLhyc7SgjvFP2jKGRl9g327gnfd6_Dmigs_uDHrXp4ajDABSyUcKfTDc4a-zkN5M5aiM3QbQjeoLhM4g99BgCHXpL1Yjn0I2Csgb0IelgQ-u9vOupcyzlLOmbLhugc3bxDlZFljYNHlfWoJzYI7SorENQ2mg_LHgYEA4OZ01FwBr8P0rD_ScqPv2J8MZu_pX276e-l5__Kn8YtAepHXZBzwh7UgjE4YDCkQPhiEToXk4QRt5pdjvt_8Yv7EOCf7HLWNCYEAlj4ShOEOjidEDyQSKhIsDRTqOk3X2jPwTiZcmWPaE-OWd5WkX1wxqGeskIDr9PxGux78Y_4rvroJBnlMrYQJG9cJLEpqlUF_eJuTWgRtFfa_wkcXZwRueXkLRMWMKARBpCOPjFer6j1VMXU5tQNnoYx_l62VDxV1I7oQAo6pznRSkyhiJrt2nBs6oqZa3EVna1ENuqVEVXpou8JYuxScuy5EVeMh7LJpN1Vos46DBi87SjCTREZ-3cgza0aIhx9XId5I2Kikeatqh4fnvg4smNzceo0KP2fqLp4buiyussHhohlcpylZftts1ypljFyiotGKEiZ4WMR9Hi6BvqiNqJdcMZ5ynjjFW8LuqEhEllJruSSc47UUY5w73QY7IUTqzrY9esPbRT7wkctQ_-BgrvdW8Qr_nFFAbrGjmfpm92jtd2m7XXH0MdB8s">