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

Dale Johannesen dalej at apple.com
Wed May 28 11:32:17 PDT 2008


On May 28, 2008, at 11:20 AM, Chris Lattner wrote:

>
> On May 28, 2008, at 11:19 AM, Dale Johannesen wrote:
>
>>
>> On May 28, 2008, at 11:16 AM, Chris Lattner wrote:
>>
>>>
>>> On May 28, 2008, at 9:18 AM, Dale Johannesen wrote:
>>>
>>>> volatile?
>>>
>>> memmove isn't volatile.
>>
>> Its arguments may be ptr-to-volatile, and in that case the transform
>> is invalid.
>
> 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.






More information about the llvm-commits mailing list