[llvm-dev] @llvm.memcpy not honoring volatile?

John Regehr via llvm-dev llvm-dev at lists.llvm.org
Mon Jun 10 13:51:04 PDT 2019


I agree, this is a bug.

John


On 6/7/19 11:48 AM, JF Bastien via llvm-dev wrote:
> 
> 
>> On Jun 5, 2019, at 2:28 PM, Tim Northover via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>>
>> On Wed, 5 Jun 2019 at 13:49, Eli Friedman via llvm-dev
>> <llvm-dev at lists.llvm.org> wrote:
>>> I don’t see any particular reason to guarantee that a volatile memcpy will access each byte exactly once.  How is that useful?
>>
>> I agree it's probably not that useful, but I think the non-duplicating
>> property of volatile is ingrained strongly enough that viewing a
>> memcpy as a single load and store to each unit (in an unspecified
>> order) should be legitimate; so I think this actually is a bug.
>>
>> As the documentation says though, it's unwise to depend on the
>> behaviour of a volatile memcpy.
> 
> I agree with Tim, this seems like a bug. My expectation is that volatile touch each memory location exactly once, unless absolutely impossible (e.g. bitfields on most ISAs).
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> 


More information about the llvm-dev mailing list