Commit e2104f59 by Richard Guenther Committed by Richard Biener

tree-ssa-ccp.c (maybe_fold_stmt_indirect): Do not mess with TREE_THIS_VOLATILE on shared nodes.

2008-08-20  Richard Guenther  <rguenther@suse.de>

	* tree-ssa-ccp.c (maybe_fold_stmt_indirect): Do not mess
	with TREE_THIS_VOLATILE on shared nodes.
	(fold_stmt_r): Likewise.

	* gcc.c-torture/compile/20080820-1.c: New testcase.

From-SVN: r139325
parent 5e5dc75a
2008-08-20 Richard Guenther <rguenther@suse.de>
* tree-ssa-ccp.c (maybe_fold_stmt_indirect): Do not mess
with TREE_THIS_VOLATILE on shared nodes.
(fold_stmt_r): Likewise.
2008-08-20 Jakub Jelinek <jakub@redhat.com>
PR c/37171
......
2008-08-20 Richard Guenther <rguenther@suse.de>
* gcc.c-torture/compile/20080820-1.c: New testcase.
2008-08-20 Jakub Jelinek <jakub@redhat.com>
PR c/37171
......
extern unsigned long volatile jiffies;
void do_timer(void)
{
(*(unsigned long *)&jiffies)++;
}
......@@ -2118,7 +2118,11 @@ maybe_fold_stmt_indirect (tree expr, tree base, tree offset)
TREE_TYPE (expr));
if (t)
{
TREE_THIS_VOLATILE (t) = volatile_p;
/* Preserve volatileness of the original expression.
We can end up with a plain decl here which is shared
and we shouldn't mess with its flags. */
if (!SSA_VAR_P (t))
TREE_THIS_VOLATILE (t) = volatile_p;
return t;
}
}
......@@ -2404,8 +2408,11 @@ fold_stmt_r (tree *expr_p, int *walk_subtrees, void *data)
if (t)
{
/* Preserve volatileness of the original expression. */
TREE_THIS_VOLATILE (t) = volatile_p;
/* Preserve volatileness of the original expression.
We can end up with a plain decl here which is shared
and we shouldn't mess with its flags. */
if (!SSA_VAR_P (t))
TREE_THIS_VOLATILE (t) = volatile_p;
*expr_p = t;
*changed_p = true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment