[compiler-rt] r195624 - [ASan] Un-break the Windows build

Timur Iskhodzhanov timurrrr at google.com
Tue Nov 26 00:13:57 PST 2013


2013/11/25 Reid Kleckner <rnk at google.com>

> On Sun, Nov 24, 2013 at 11:54 PM, Timur Iskhodzhanov <timurrrr at google.com>wrote:
>
>> Author: timurrrr
>> Date: Mon Nov 25 01:54:55 2013
>> New Revision: 195624
>>
>
>
>> Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.cc
>>
>> URL:
>> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.cc?rev=195624&r1=195623&r2=195624&view=diff
>>
>> ==============================================================================
>> --- compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.cc (original)
>> +++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.cc Mon Nov 25
>> 01:54:55 2013
>> @@ -18,7 +18,12 @@ namespace __sanitizer {
>>
>>  // Make the compiler think that something is going on there.
>>  static inline void break_optimization(void *arg) {
>> +#ifdef SANITIZER_WINDOWS
>> +  // FIXME: make sure this is actually enough.
>>
>
> I believe _ReadWriteBarrier is what you want:
> http://msdn.microsoft.com/en-us/library/f20w0x5e(v=vs.120).aspx
>
> It's deprecated because people think it emits fence instructions, but it
> only prevents compiler reordering.  That's exactly what you want in this
> case.
>

Thanks for the pointer!

However, I don't feel like I want to use something that's clearly marked as
deprecated and was meant for a slightly different purpose and gives few
benefits :)
Do you think volatile + /volatile:iso would help?


>  +  __asm;
>> +#else
>>    __asm__ __volatile__("" : : "r" (arg) : "memory");
>> +#endif
>>  }
>>
>>  s64 internal_atoll(const char *nptr) {
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131126/dc3b2d41/attachment.html>


More information about the llvm-commits mailing list