re PR sanitizer/65400 (tsan mis-compiles inlineable C functions)
authorJakub Jelinek <jakub@gcc.gnu.org>
Thu, 19 Mar 2015 07:53:38 +0000 (08:53 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 19 Mar 2015 07:53:38 +0000 (08:53 +0100)
commitbfd714822b2c97dfcc970c722f430ca995eebafc
treed66c13575e21970d004baf7ab6afa1494b91bd8b
parent995332cad37e5724a88a9a3cdfb3008248d5257e
re PR sanitizer/65400 (tsan mis-compiles inlineable C functions)

PR sanitizer/65400
* ipa-split.c (find_return_bb): Allow TSAN_FUNC_EXIT internal
call in the return bb.
(find_split_points): Add RETURN_BB argument, don't call
find_return_bb.
(split_function): Likewise.  Add ADD_TSAN_FUNC_EXIT argument,
if true append TSAN_FUNC_EXIT internal call after the call to
the split off function.
(execute_split_functions): Call find_return_bb here.
Don't optimize if TSAN_FUNC_EXIT is found in unexpected places.
Adjust find_split_points and split_function calls.

* c-c++-common/tsan/pr65400-1.c: New test.
* c-c++-common/tsan/pr65400-2.c: New test.

From-SVN: r221508
gcc/ChangeLog
gcc/ipa-split.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/tsan/pr65400-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/tsan/pr65400-2.c [new file with mode: 0644]