aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-operands.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2007-09-01 09:07:17 +0000
committerRichard Guenther <rguenther@suse.de>2007-09-01 09:07:17 +0000
commit2c1fb877391246e68260e46b7b56ef8aad14c03e (patch)
tree52ed878bcfb4c2023c1cf9eea40a00902d2eb7b6 /gcc/tree-ssa-operands.c
parentcb3ccee77fbcb6f3320736e77bd08d544e6d3a67 (diff)
2007-09-01 Richard Guenther <rguenther@suse.de>
* tree-ssa-alias.c (create_name_tags): Use TYPE_VOLATILE instead of TREE_THIS_VOLATILE. * tree-ssa-operands.c (add_virtual_operand): Do not set has_volatile_ops. Do not check s_ann for NULL. (get_indirect_ref_operands): Likewise. (get_expr_operands): Likewise. For all reference trees set has_volatile_ops based on TREE_THIS_VOLATILE. Also check base of reference for TREE_THIS_VOLATILE. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@128012 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-operands.c')
-rw-r--r--gcc/tree-ssa-operands.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c
index 7217b554ff0..4996e09e854 100644
--- a/gcc/tree-ssa-operands.c
+++ b/gcc/tree-ssa-operands.c
@@ -1466,11 +1466,6 @@ add_virtual_operand (tree var, stmt_ann_t s_ann, int flags,
/* Mark the statement as having memory operands. */
s_ann->references_memory = true;
- /* Mark statements with volatile operands. Optimizers should back
- off from statements having volatile operands. */
- if (TREE_THIS_VOLATILE (sym) && s_ann)
- s_ann->has_volatile_ops = true;
-
/* If the variable cannot be modified and this is a VDEF change
it into a VUSE. This happens when read-only variables are marked
call-clobbered and/or aliased to writable variables. So we only
@@ -1499,7 +1494,7 @@ add_virtual_operand (tree var, stmt_ann_t s_ann, int flags,
if (aliases == NULL)
{
- if (s_ann && !gimple_aliases_computed_p (cfun))
+ if (!gimple_aliases_computed_p (cfun))
s_ann->has_volatile_ops = true;
/* The variable is not aliased or it is an alias tag. */
@@ -1630,7 +1625,7 @@ get_indirect_ref_operands (tree stmt, tree expr, int flags,
stmt_ann_t s_ann = stmt_ann (stmt);
s_ann->references_memory = true;
- if (s_ann && TREE_THIS_VOLATILE (expr))
+ if (TREE_THIS_VOLATILE (expr))
s_ann->has_volatile_ops = true;
if (SSA_VAR_P (ptr))
@@ -1677,8 +1672,7 @@ get_indirect_ref_operands (tree stmt, tree expr, int flags,
/* Aliasing information is missing; mark statement as
volatile so we won't optimize it out too actively. */
- else if (s_ann
- && !gimple_aliases_computed_p (cfun)
+ else if (!gimple_aliases_computed_p (cfun)
&& (flags & opf_def))
s_ann->has_volatile_ops = true;
}
@@ -1688,8 +1682,7 @@ get_indirect_ref_operands (tree stmt, tree expr, int flags,
/* If a constant is used as a pointer, we can't generate a real
operand for it but we mark the statement volatile to prevent
optimizations from messing things up. */
- if (s_ann)
- s_ann->has_volatile_ops = true;
+ s_ann->has_volatile_ops = true;
return;
}
else
@@ -2121,6 +2114,9 @@ get_expr_operands (tree stmt, tree *expr_p, int flags)
HOST_WIDE_INT offset, size, maxsize;
bool none = true;
+ if (TREE_THIS_VOLATILE (expr))
+ s_ann->has_volatile_ops = true;
+
/* This component reference becomes an access to all of the
subvariables it can touch, if we can determine that, but
*NOT* the real one. If we can't determine which fields we
@@ -2148,8 +2144,10 @@ get_expr_operands (tree stmt, tree *expr_p, int flags)
if (!none)
flags |= opf_no_vops;
- if (TREE_THIS_VOLATILE (expr))
- get_stmt_ann (stmt)->has_volatile_ops = true;
+ if ((DECL_P (ref) && TREE_THIS_VOLATILE (ref))
+ || (TREE_CODE (ref) == SSA_NAME
+ && TREE_THIS_VOLATILE (SSA_NAME_VAR (ref))))
+ s_ann->has_volatile_ops = true;
}
else if (TREE_CODE (ref) == INDIRECT_REF)
{
@@ -2165,7 +2163,7 @@ get_expr_operands (tree stmt, tree *expr_p, int flags)
if (code == COMPONENT_REF)
{
- if (s_ann && TREE_THIS_VOLATILE (TREE_OPERAND (expr, 1)))
+ if (TREE_THIS_VOLATILE (TREE_OPERAND (expr, 1)))
s_ann->has_volatile_ops = true;
get_expr_operands (stmt, &TREE_OPERAND (expr, 2), opf_use);
}