summaryrefslogtreecommitdiff
path: root/gcc/tsan.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tsan.c')
-rw-r--r--gcc/tsan.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/tsan.c b/gcc/tsan.c
index c02e100cca0..79b8bc395d3 100644
--- a/gcc/tsan.c
+++ b/gcc/tsan.c
@@ -131,7 +131,8 @@ instrument_expr (gimple_stmt_iterator gsi, tree expr, bool is_write)
if (TREE_READONLY (base))
return false;
- if (bitpos % (size * BITS_PER_UNIT)
+ if (size == 0
+ || bitpos % (size * BITS_PER_UNIT)
|| bitsize != size * BITS_PER_UNIT)
return false;