[llvm-commits] [llvm] r51636 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/memmove.ll

Chris Lattner clattner at apple.com
Wed May 28 11:35:52 PDT 2008


On May 28, 2008, at 11:32 AM, Dale Johannesen wrote:
>> memmove takes void* arguments, so when you pass pointer to volatile,
>> the implicit conversion strips off volatile.  Is there some part of
>> the standard I'm missing here?
>
>
> I guess you are right.  C99 6.7.3 "If an attempt is made to refer to
> an object defined with a volatile-qualified type through use of an
> lvalue
> with non-volatile-qualified type, the behavior is undefined."  So
> this is undefined behavior, and the FE does warn about it; I suppose
> this isn't the right place to check again.

I guess the case that matters is when the CFE turns volatile struct  
assignment into a memcpy.  We should probably add a isvolatile flag to  
llvm.memcpy/memmove/memset just for completeness.

-Chris 



More information about the llvm-commits mailing list