<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 - SimplifyLibCalls doesn't handle attributes on call sites well"
   href="https://bugs.llvm.org/show_bug.cgi?id=49984">49984</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>SimplifyLibCalls doesn't handle attributes on call sites well
          </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>Linux
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Scalar Optimizations
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>jdoerfert@anl.gov
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>david.bolvansky@gmail.com, florian_hahn@apple.com, listmail@philipreames.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When we have an attribute on a call site that is changed, SimplifyLibCalls
causes an assertion. The code shows one example, others are likely.

Test taken from `0c0de794f1affc7460eb90626b8483e4a0cbde6c`:

<a href="https://godbolt.org/z/vG7acndfz">https://godbolt.org/z/vG7acndfz</a>

```
target datalayout =
"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" 

@null = constant [1 x i8] zeroinitializer

define i8* @test3(i8* %dst, i32 %n) {
  %src = getelementptr [1 x i8], [1 x i8]* @null, i32 0, i32 0
  %ret = call i8* @strncpy(i8* align(16) noalias nonnull %dst, i8* nonnull
%src, i32 5)
  ret i8* %ret


declare i8* @strncpy(i8*, i8*, i32)
```</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>