+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.
+
2007-09-01 Richard Guenther <rguenther@suse.de>
* tree-cfg.c (verify_gimple_expr): Fix check for conversions
/* 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
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. */
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))
/* 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;
}
/* 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
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
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)
{
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);
}