This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tsan] ThreadSanitizer instrumentation part
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Xinliang David Li <davidxl at google dot com>
- Cc: Wei Mi <wmi at google dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Dmitry Vyukov <dvyukov at google dot com>, Diego Novillo <dnovillo at google dot com>, Dodji Seketeli <dodji at redhat dot com>
- Date: Thu, 1 Nov 2012 07:27:36 +0100
- Subject: Re: [tsan] ThreadSanitizer instrumentation part
- References: <CAAkRFZKrTWFp9L3yom-qO4RTH6YUvfnkKs_jX7sZGsmdJDv5cA@mail.gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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.
Jakub