re PR sanitizer/64336 (Template functions are not instrumented at -O0 and -Og)

PR sanitizer/64336
	* tree.c (build2_stat): Fix up initialization of TREE_READONLY
	and TREE_THIS_VOLATILE for MEM_REFs.
	(build5_stat): Fix up initialization of TREE_READONLY and
	TREE_THIS_VOLATILE for TARGET_MEM_REFs.

From-SVN: r219339
This commit is contained in:
Jakub Jelinek 2015-01-08 10:20:24 +01:00 committed by Jakub Jelinek
parent ae6b8666c9
commit bd84df1879
2 changed files with 38 additions and 8 deletions

View file

@ -1,3 +1,11 @@
2015-01-08 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/64336
* tree.c (build2_stat): Fix up initialization of TREE_READONLY
and TREE_THIS_VOLATILE for MEM_REFs.
(build5_stat): Fix up initialization of TREE_READONLY and
TREE_THIS_VOLATILE for TARGET_MEM_REFs.
2015-01-08 Kaz Kojima <kkojima@gcc.gnu.org>
PR target/64533

View file

@ -4358,12 +4358,24 @@ build2_stat (enum tree_code code, tree tt, tree arg0, tree arg1 MEM_STAT_DECL)
PROCESS_ARG (0);
PROCESS_ARG (1);
TREE_READONLY (t) = read_only;
TREE_CONSTANT (t) = constant;
TREE_SIDE_EFFECTS (t) = side_effects;
TREE_THIS_VOLATILE (t)
= (TREE_CODE_CLASS (code) == tcc_reference
&& arg0 && TREE_THIS_VOLATILE (arg0));
if (code == MEM_REF)
{
if (arg0 && TREE_CODE (arg0) == ADDR_EXPR)
{
tree o = TREE_OPERAND (arg0, 0);
TREE_READONLY (t) = TREE_READONLY (o);
TREE_THIS_VOLATILE (t) = TREE_THIS_VOLATILE (o);
}
}
else
{
TREE_READONLY (t) = read_only;
TREE_CONSTANT (t) = constant;
TREE_THIS_VOLATILE (t)
= (TREE_CODE_CLASS (code) == tcc_reference
&& arg0 && TREE_THIS_VOLATILE (arg0));
}
return t;
}
@ -4458,9 +4470,19 @@ build5_stat (enum tree_code code, tree tt, tree arg0, tree arg1,
PROCESS_ARG (4);
TREE_SIDE_EFFECTS (t) = side_effects;
TREE_THIS_VOLATILE (t)
= (TREE_CODE_CLASS (code) == tcc_reference
&& arg0 && TREE_THIS_VOLATILE (arg0));
if (code == TARGET_MEM_REF)
{
if (arg0 && TREE_CODE (arg0) == ADDR_EXPR)
{
tree o = TREE_OPERAND (arg0, 0);
TREE_READONLY (t) = TREE_READONLY (o);
TREE_THIS_VOLATILE (t) = TREE_THIS_VOLATILE (o);
}
}
else
TREE_THIS_VOLATILE (t)
= (TREE_CODE_CLASS (code) == tcc_reference
&& arg0 && TREE_THIS_VOLATILE (arg0));
return t;
}