summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-operands.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-08 15:08:16 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-08 15:08:16 +0000
commit587838bb0bd54e2b8be6347e515d2c755a3ab85d (patch)
treecf170603549b65a83b8471dc9e2ce0b6de209fb2 /gcc/tree-ssa-operands.c
parent12f0f6d77dbac8ef1d119fb6a2b2fc91f7d09d56 (diff)
downloadgcc-587838bb0bd54e2b8be6347e515d2c755a3ab85d.tar.gz
2011-12-08 Richard Guenther <rguenther@suse.de>
* tree-ssa-operands.c (add_stmt_operand): Do not mark stmts volatile when processing operands of an ADDR_EXPR. (get_indirect_ref_operands): Likewise. (get_tmr_operands): Likewise. (get_expr_operands): Likewise. * gcc.dg/volatile3.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182117 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-operands.c')
-rw-r--r--gcc/tree-ssa-operands.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c
index 3de34be7948..0045dd875ec 100644
--- a/gcc/tree-ssa-operands.c
+++ b/gcc/tree-ssa-operands.c
@@ -668,7 +668,8 @@ add_stmt_operand (tree *var_p, gimple stmt, int flags)
sym = (TREE_CODE (var) == SSA_NAME ? SSA_NAME_VAR (var) : var);
/* Mark statements with volatile operands. */
- if (TREE_THIS_VOLATILE (sym))
+ if (!(flags & opf_no_vops)
+ && TREE_THIS_VOLATILE (sym))
gimple_set_has_volatile_ops (stmt, true);
if (is_gimple_reg (sym))
@@ -728,7 +729,8 @@ get_indirect_ref_operands (gimple stmt, tree expr, int flags,
{
tree *pptr = &TREE_OPERAND (expr, 0);
- if (TREE_THIS_VOLATILE (expr))
+ if (!(flags & opf_no_vops)
+ && TREE_THIS_VOLATILE (expr))
gimple_set_has_volatile_ops (stmt, true);
/* Add the VOP. */
@@ -747,7 +749,8 @@ get_indirect_ref_operands (gimple stmt, tree expr, int flags,
static void
get_tmr_operands (gimple stmt, tree expr, int flags)
{
- if (TREE_THIS_VOLATILE (expr))
+ if (!(flags & opf_no_vops)
+ && TREE_THIS_VOLATILE (expr))
gimple_set_has_volatile_ops (stmt, true);
/* First record the real operands. */
@@ -914,14 +917,16 @@ get_expr_operands (gimple stmt, tree *expr_p, int flags)
case REALPART_EXPR:
case IMAGPART_EXPR:
{
- if (TREE_THIS_VOLATILE (expr))
+ if (!(flags & opf_no_vops)
+ && TREE_THIS_VOLATILE (expr))
gimple_set_has_volatile_ops (stmt, true);
get_expr_operands (stmt, &TREE_OPERAND (expr, 0), flags);
if (code == COMPONENT_REF)
{
- if (TREE_THIS_VOLATILE (TREE_OPERAND (expr, 1)))
+ if (!(flags & opf_no_vops)
+ && TREE_THIS_VOLATILE (TREE_OPERAND (expr, 1)))
gimple_set_has_volatile_ops (stmt, true);
get_expr_operands (stmt, &TREE_OPERAND (expr, 2), uflags);
}
@@ -960,7 +965,8 @@ get_expr_operands (gimple stmt, tree *expr_p, int flags)
/* A volatile constructor is actually TREE_CLOBBER_P, transfer
the volatility to the statement, don't use TREE_CLOBBER_P for
mirroring the other uses of THIS_VOLATILE in this file. */
- if (TREE_THIS_VOLATILE (expr))
+ if (!(flags & opf_no_vops)
+ && TREE_THIS_VOLATILE (expr))
gimple_set_has_volatile_ops (stmt, true);
for (idx = 0;
@@ -972,7 +978,8 @@ get_expr_operands (gimple stmt, tree *expr_p, int flags)
}
case BIT_FIELD_REF:
- if (TREE_THIS_VOLATILE (expr))
+ if (!(flags & opf_no_vops)
+ && TREE_THIS_VOLATILE (expr))
gimple_set_has_volatile_ops (stmt, true);
/* FALLTHRU */