===================================================================
@@ -726,13 +726,20 @@
struct mop_desc mop;
unsigned fld_off;
unsigned fld_size;
+ tree base;
+
+ base = get_base_address (expr);
+ if (base == NULL_TREE
+ || TREE_CODE (base) == SSA_NAME
+ || TREE_CODE (base) == STRING_CST)
+ return;
+
tcode = TREE_CODE (expr);
/* Below are things we do not instrument
(no possibility of races or not implemented yet). */
if ((func_ignore & (tsan_ignore_mop | tsan_ignore_rec))
- || get_base_address (expr) == NULL
/* Compiler-emitted artificial variables. */
|| (DECL_P (expr) && DECL_ARTIFICIAL (expr))
/* The var does not live in memory -> no possibility of races. */
===================================================================
@@ -1,3 +1,8 @@
+2011-12-05 Dmitriy Vyukov <dvyukov@google.com>
+
+ Fix taking address of SSA_NAME in ThreadSanitizer pass.
+ * gcc/tree-tsan.c (handle_expr): Add the additional check.
+
2011-11-30 Dmitriy Vyukov <dvyukov@google.com>
Add directives to run ThreadSanitizer tests