On Mon, Dec 29, 2014 at 09:20:57PM +0100, Bernd Edlinger wrote:
> --- gcc/sanitizer.def (revision 218963)
> +++ gcc/sanitizer.def (working copy)
> @@ -188,6 +188,10 @@ DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_WRITE8, "__tsa
> BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
> DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_WRITE16, "__tsan_write16",
> BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
> +DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_READ_RANGE, "__tsan_read_range",
> + BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
> +DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_WRITE_RANGE, "__tsan_write_range",
> + BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
>
> DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC8_LOAD,
> "__tsan_atomic8_load",
For the BUILT_IN_VPTR_UPDATE builtin you also need to change
the prototype, to BT_FN_VOID_PTR_PTR. Do you have a testcase for the
__tsan_vptr_update bug? Can you submit it separately, because it
probably is desirable also for the 4.9 and 4.8 branches.
> @@ -173,13 +227,21 @@ instrument_expr (gimple_stmt_iterator gsi, tree ex
> gimple_set_location (g, loc);
> gimple_seq_add_stmt_without_update (&seq, g);
> }
> - if (rhs == NULL)
> + if ((size & -size) != size || size > 16
Isn't (size & (size - 1)) == 0 a better check?
Otherwise LGTM.
Jakub