diff options
author | Marek Polacek <polacek@redhat.com> | 2013-04-22 17:02:49 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2013-04-22 17:02:49 +0000 |
commit | 829d0168e6816e2b309bc75f4e23d28656ceed6f (patch) | |
tree | 4be5c0822b6964735a77d9c3f84745cfd4e39abb /gcc/tsan.c | |
parent | 6d9b720879c18b7f73043f6cf6fc30439c05f826 (diff) | |
download | gcc-829d0168e6816e2b309bc75f4e23d28656ceed6f.tar.gz |
re PR sanitizer/56990 (ICE: SIGFPE with -fsanitize=thread and empty struct)
PR sanitizer/56990
* tsan.c (instrument_expr): Don't instrument expression
in case its size is zero.
* gcc.dg/pr56990.c: New test.
From-SVN: r198147
Diffstat (limited to 'gcc/tsan.c')
-rw-r--r-- | gcc/tsan.c | 3 |
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; |