[compiler-rt] r210346 - tsan: fix clang warning:

David Blaikie dblaikie at gmail.com
Fri Jun 6 09:18:59 PDT 2014


Not sure - but I know we're going to have to figure some of these
things out for -Wunreachable-code and similar things (I know some of
these heuristics have already been implemented in -Wunreachable-code,
perhaps we could reuse them for other things like this)

I'd wager that even just "the constant is not a literal" (either a
global constant, or a macro, etc) might be enough signal in this case.
Perhaps Richard (cc'd) has some idea about how many of the hits on
this warning in google were with literals versus not.

On Fri, Jun 6, 2014 at 9:15 AM, Dmitry Vyukov <dvyukov at google.com> wrote:
> how would it figure out that something is implementation-defined?
>
>
> On Fri, Jun 6, 2014 at 8:13 PM, David Blaikie <dblaikie at gmail.com> wrote:
>> Should we try to fix the Clang warning so it doesn't fire on
>> possibly-implementation-defined constants like this?
>>
>> On Fri, Jun 6, 2014 at 8:51 AM, Dmitry Vyukov <dvyukov at google.com> wrote:
>>> Author: dvyukov
>>> Date: Fri Jun  6 10:51:20 2014
>>> New Revision: 210346
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=210346&view=rev
>>> Log:
>>> tsan: fix clang warning:
>>> comparison of unsigned expression >= 0 is always true
>>>
>>>
>>> Modified:
>>>     compiler-rt/trunk/lib/tsan/rtl/tsan_platform.h
>>>
>>> Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_platform.h
>>> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_platform.h?rev=210346&r1=210345&r2=210346&view=diff
>>> ==============================================================================
>>> --- compiler-rt/trunk/lib/tsan/rtl/tsan_platform.h (original)
>>> +++ compiler-rt/trunk/lib/tsan/rtl/tsan_platform.h Fri Jun  6 10:51:20 2014
>>> @@ -131,6 +131,8 @@ static inline bool IsAppMem(uptr mem) {
>>>  #if defined(TSAN_COMPAT_SHADOW) && TSAN_COMPAT_SHADOW
>>>    return (mem >= kLinuxAppMemBeg && mem < kAppMemGapBeg) ||
>>>           (mem >= kAppMemGapEnd   && mem <= kLinuxAppMemEnd);
>>> +#elif defined(TSAN_GO)
>>> +  return mem <= kLinuxAppMemEnd;
>>>  #else
>>>    return mem >= kLinuxAppMemBeg && mem <= kLinuxAppMemEnd;
>>>  #endif
>>>
>>>
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list