re PR sanitizer/55702 (ICE: in instrument_func_exit, at tsan.c:684 with -fsanitize=thread and __builtin_return())

PR sanitizer/55702
	* tsan.c (instrument_func_exit): Allow BUILT_IN_RETURN
	functions.

	* gcc.dg/pr55702.c: New test.

From-SVN: r197430
This commit is contained in:
Marek Polacek 2013-04-03 16:01:38 +00:00 committed by Marek Polacek
parent 4a32ef809a
commit 71c581e77d
4 changed files with 22 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2013-04-03 Marek Polacek <polacek@redhat.com>
PR sanitizer/55702
* tsan.c (instrument_func_exit): Allow BUILT_IN_RETURN
functions.
2013-04-03 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR target/56809

View File

@ -1,3 +1,8 @@
2013-04-03 Marek Polacek <polacek@redhat.com>
PR sanitizer/55702
* gcc.dg/pr55702.c: New test.
2013-04-03 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR target/56809

View File

@ -0,0 +1,9 @@
/* PR sanitizer/55702 */
/* { dg-do compile { target { x86_64-*-linux* && lp64 } } } */
/* { dg-options "-fsanitize=thread" } */
void
foo ()
{
__builtin_return (0);
}

View File

@ -681,7 +681,8 @@ instrument_func_exit (void)
{
gsi = gsi_last_bb (e->src);
stmt = gsi_stmt (gsi);
gcc_assert (gimple_code (stmt) == GIMPLE_RETURN);
gcc_assert (gimple_code (stmt) == GIMPLE_RETURN
|| gimple_call_builtin_p (stmt, BUILT_IN_RETURN));
loc = gimple_location (stmt);
builtin_decl = builtin_decl_implicit (BUILT_IN_TSAN_FUNC_EXIT);
g = gimple_build_call (builtin_decl, 0);