<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 - [call site info / entry values] DW_AT_call_target describes clobbered register"
   href="https://bugs.llvm.org/show_bug.cgi?id=43926">43926</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[call site info / entry values] DW_AT_call_target describes clobbered register
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

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

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

        <tr>
          <th>OS</th>
          <td>All
          </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>DebugInfo
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>vsk@apple.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>jdevlieghere@apple.com, keith.walker@arm.com, llvm-bugs@lists.llvm.org, paul_robinson@playstation.sony.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When describing an indirect call, llvm may specify a clobbered register as the
call target.

Example:

```
caller:
  ...
  mov (%rdi), %rax
  callq *%rax

->

DW_TAG_call_site
  DW_AT_call_target     (DW_OP_reg0 RAX)
  DW_AT_call_return_pc  ...
```

Here, %rax is not preserved by the callee. This means that the debugger cannot
figure out the actual call target, and therefore, I believe it cannot safely
evaluate entry values in the eventual callee.

Example: `callq *%rax` may branch to `tail_calling_helper`, which can tail call
`eventual_callee`; alternatively, `callq *%rax` can branch to `eventual_callee`
immediately. The debugger simply does not know the call target, so it does not
know which function to search for call site parameter infos.

How does gcc handle this? Should llvm attempt to "work backwards" to find a
non-clobbered description of the call target (perhaps using the existing
`describeLoadedValue` API)?</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>