[llvm-dev] RFC: Killing undef and spreading poison

Chris Lattner via llvm-dev llvm-dev at lists.llvm.org
Mon Oct 24 12:57:40 PDT 2016


> On Oct 19, 2016, at 6:12 AM, Joerg Sonnenberger via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> On Wed, Oct 19, 2016 at 03:44:05PM +0300, Bruce Hoult via llvm-dev wrote:
>> I'm curious. Where is it defined that memcpy is byte by byte not, for
>> example, bit by bit? Why is the destination not identical to the source,
>> with exactly the same bits poison?
> 
> The fundamental unit in C is a char.

This approach won’t work for LLVM thought.  It is perfectly fine in C to have an initialized bitfield in an otherwise uninitialized object.  Use of the initialized part is acceptable, and the initialized aspect of it needs to propagate through memcpy.

-Chris


More information about the llvm-dev mailing list