aboutsummaryrefslogtreecommitdiff
path: root/gcc/tsan.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@gcc.gnu.org>2015-03-19 11:12:34 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2015-03-19 11:12:34 +0100
commita3f94967e1dc590516bd10938bb049af8441f1a3 (patch)
tree0dea73fba72b7c5ab55b5fcbd0390f21580d0ee3 /gcc/tsan.c
parent9308995b0acf2f8bbfdbc63d3f950494388f6fa8 (diff)
downloadgcc-a3f94967e1dc590516bd10938bb049af8441f1a3.zip
gcc-a3f94967e1dc590516bd10938bb049af8441f1a3.tar.gz
gcc-a3f94967e1dc590516bd10938bb049af8441f1a3.tar.bz2
re PR sanitizer/65400 (tsan mis-compiles inlineable C functions)
PR sanitizer/65400 * tsan.c (instrument_gimple): Clear tail call flag on calls. * c-c++-common/tsan/pr65400-3.c: New test. From-SVN: r221512
Diffstat (limited to 'gcc/tsan.c')
-rw-r--r--gcc/tsan.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tsan.c b/gcc/tsan.c
index ae89d5f..ebafbb0 100644
--- a/gcc/tsan.c
+++ b/gcc/tsan.c
@@ -680,6 +680,10 @@ instrument_gimple (gimple_stmt_iterator *gsi)
&& (gimple_call_fndecl (stmt)
!= builtin_decl_implicit (BUILT_IN_TSAN_INIT)))
{
+ /* All functions with function call will have exit instrumented,
+ therefore no function calls other than __tsan_func_exit
+ shall appear in the functions. */
+ gimple_call_set_tail (as_a <gcall *> (stmt), false);
if (gimple_call_builtin_p (stmt, BUILT_IN_NORMAL))
instrument_builtin_call (gsi);
return true;