[llvm-dev] Which assumptions do llvm.memcpy/memmove/memset.* make when the count is 0?

Joerg Sonnenberger via llvm-dev llvm-dev at lists.llvm.org
Fri Jul 21 11:39:44 PDT 2017


On Fri, Jul 21, 2017 at 09:31:41AM -0600, John Regehr via llvm-dev wrote:
> I propose documenting in the LangRef that memcpy and related intrinsics are
> defined even when src and dst don't refer to valid storage as long as the
> length argument is zero. Then we commit to implementing that behavior. Is
> that OK with everyone? If so I can update the doc.

I don't think that was the conclusion of the discussion? I mean the
result was that a NULL pointer should be explicitly valid if the length
argument is zero. That's a bit more restrictive.

Joerg


More information about the llvm-dev mailing list