<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 - Clarify assumptions of llvm.memcpy/memmove/memset.* when count is 0"
   href="https://bugs.llvm.org/show_bug.cgi?id=38583">38583</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clarify assumptions of llvm.memcpy/memmove/memset.* when count is 0
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Documentation
          </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>General docs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>post+llvm@ralfj.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Last year, I asked on the mailing list [0] to clarify which are the assumptions
that LLVM makes when llvm.memcpy/memmove/memset.* (the intrinsics, not the C
functions) are called with a count of 0 -- including the case where the count
is not statically known, but happens to be 0 at run-time.  The concept of a
"dangling" pointer does not make much sense for size 0 (by definition, all the
bytes it points to are allocated because it points to no bytes).  However, some
questions remain open.  Specifically:

- Is it okay for some of the pointers to be NULL?
- Is it okay for some of the pointers to not be aligned, even though the
annotation says they should be aligned?

Having definite answers to such questions is important for us in Rust, so that
we can settle in rules for our intrinsics that compile to LLVM's. I hope the
"Documentation" product is the right one for such issues.

[0] <a href="https://lists.llvm.org/pipermail/llvm-dev/2017-July/115665.html">https://lists.llvm.org/pipermail/llvm-dev/2017-July/115665.html</a></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>