Hi Jakub,
I think I have found a reasonable test case, see the attached patch file. The use case is: a class that destroys an owned thread in the destructor. The destructor sets the vptr again to thread::vptr but this should _not_ trigger a diagnostic message, when the vptr does not really change. Jakub, this is another test case where the TREE_READONLY prevents the tsan instrumentation. So I had first to install your patch: https://gcc.gnu.org/ml/gcc-patches/2014-12/msg01432.html ... to see the test case fail without my patch. The patch installs cleanly on 4.9 and 4.8, however the 4.8 branch has no tsan tests, so I would leave the test case away for 4.8. Boot-strapped and regression-tested on x86_64-linux-gnu OK for trunk and 4.9 + 4.8 branches? Thanks Bernd.
gcc/ChangeLog: 2015-01-04 Bernd Edlinger <bernd.edlin...@hotmail.de> * sanititer.c (BUILT_IN_TSAN_VPTR_UPDATE): Fixed parameters. * tsan.c (instrument_expr): Fixed parameters of __tsan_vptr_update. gcc/testsuite/ChangeLog 2015-01-04 Bernd Edlinger <bernd.edlin...@hotmail.de> * g++.dg/tsan/vptr_update.C: New testcase.
patch-tsan-vptr.diff
Description: Binary data