re PR sanitizer/57104 (ICE: in expand_expr_addr_expr_1, at expr.c:7594 with -fsanitize=thread and hardreg variable)

PR tree-optimization/57104
	* tsan.c (instrument_expr): Don't instrument accesses to
	DECL_HARD_REGISTER VAR_DECLs.

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

From-SVN: r198445
This commit is contained in:
Jakub Jelinek 2013-04-30 10:52:39 +02:00 committed by Jakub Jelinek
parent a46d0aff5e
commit abc27962b8
4 changed files with 26 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2013-04-30 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/57104
* tsan.c (instrument_expr): Don't instrument accesses to
DECL_HARD_REGISTER VAR_DECLs.
2013-04-30 Richard Biener <rguenther@suse.de>
* function.h (loops_for_fn): New inline function.

View File

@ -1,3 +1,8 @@
2013-04-30 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/57104
* gcc.dg/pr57104.c: New test.
2013-04-29 Uros Bizjak <ubizjak@gmail.com>
PR target/44578

View File

@ -0,0 +1,12 @@
/* PR tree-optimization/57104 */
/* { dg-do compile { target { x86_64-*-linux* && lp64 } } } */
/* { dg-options "-fsanitize=thread" } */
register int r asm ("r14");
int v;
int
foo (void)
{
return r + v;
}

View File

@ -128,7 +128,9 @@ instrument_expr (gimple_stmt_iterator gsi, tree expr, bool is_write)
return false;
}
if (TREE_READONLY (base))
if (TREE_READONLY (base)
|| (TREE_CODE (base) == VAR_DECL
&& DECL_HARD_REGISTER (base)))
return false;
if (size == 0