re PR sanitizer/81275 (-fsanitize=thread produce incorrect -Wreturn-type warning)
authorJakub Jelinek <jakub@redhat.com>
Tue, 28 Nov 2017 21:22:52 +0000 (22:22 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 28 Nov 2017 21:22:52 +0000 (22:22 +0100)
commit058f0b9e5f073da9d1d98a91e482cbdead1561ee
tree54a203fbcbecced881bb3fc81e309166d8c9ad5b
parent67c24a8bd6141021da49e005c0111bd42bfc7d08
re PR sanitizer/81275 (-fsanitize=thread produce incorrect -Wreturn-type warning)

PR sanitizer/81275
* tree.c (block_may_fallthru): Return false if SWITCH_ALL_CASES_P
is set on SWITCH_EXPR and !block_may_fallthru (SWITCH_BODY ()).
c/
* c-typeck.c (c_finish_case): Set SWITCH_ALL_CASES_P if
c_switch_covers_all_cases_p returns true.
c-family/
* c-common.c (c_switch_covers_all_cases_p_1,
c_switch_covers_all_cases_p): New functions.
* c-common.h (c_switch_covers_all_cases_p): Declare.
testsuite/
* c-c++-common/tsan/pr81275.c: New test.

From-SVN: r255217
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c-family/c-common.h
gcc/c/ChangeLog
gcc/c/c-typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/tsan/pr81275.c [new file with mode: 0644]
gcc/tree.c
gcc/tree.h