[llvm-bugs] [Bug 38583] New: Clarify assumptions of llvm.memcpy/memmove/memset.* when count is 0

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Aug 15 12:20:58 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=38583

            Bug ID: 38583
           Summary: Clarify assumptions of llvm.memcpy/memmove/memset.*
                    when count is 0
           Product: Documentation
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: General docs
          Assignee: unassignedbugs at nondot.org
          Reporter: post+llvm at ralfj.de
                CC: llvm-bugs at lists.llvm.org

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] https://lists.llvm.org/pipermail/llvm-dev/2017-July/115665.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180815/677dcb48/attachment.html>


More information about the llvm-bugs mailing list