[tsan] ThreadSanitizer instrumentation part

Xinliang David Li davidxl@google.com
Thu Nov 1 15:47:00 GMT 2012


On Wed, Oct 31, 2012 at 11:27 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Wed, Oct 31, 2012 at 11:00:17PM -0700, Xinliang David Li wrote:
>> > +  /* Below are things we do not instrument
>> > +     (no possibility of races or not implemented yet).  */
>> > +  if (/* Compiler-emitted artificial variables.  */
>> > +      (DECL_P (expr) && DECL_ARTIFICIAL (expr))
>> > +      /* The var does not live in memory -> no possibility of races.  */
>> > +      || (tcode == VAR_DECL
>> > +          && TREE_ADDRESSABLE (expr) == 0
>>
>>  ==> !TREE_ADDRESSABLE (expr)
>>
>> > +         && TREE_STATIC (expr) == 0)
>>
>>
>> To detect stack varaible, TREE_STATIC can not be used.  Use
>> !DECL_EXTERNAL instead.
>
> TREE_STATIC is right for that.

Hmm, what does this condition try to capture then?

David

>
>         Jakub



More information about the Gcc-patches mailing list