we find a VN result with exactly the same value as the
possible clobber. In this case we can ignore the clobber
and return the found value. */
- if (is_gimple_reg_type (TREE_TYPE (lhs))
+ if (!gimple_has_volatile_ops (def_stmt)
+ && is_gimple_reg_type (TREE_TYPE (lhs))
&& types_compatible_p (TREE_TYPE (lhs), vr->type)
&& (ref->ref || data->orig_ref.ref)
&& !data->mask
else if (is_gimple_reg_type (vr->type)
&& gimple_assign_single_p (def_stmt)
&& gimple_assign_rhs_code (def_stmt) == CONSTRUCTOR
- && CONSTRUCTOR_NELTS (gimple_assign_rhs1 (def_stmt)) == 0)
+ && CONSTRUCTOR_NELTS (gimple_assign_rhs1 (def_stmt)) == 0
+ && !TREE_THIS_VOLATILE (gimple_assign_lhs (def_stmt)))
{
tree base2;
poly_int64 offset2, size2, maxsize2;
&& !reverse_storage_order_for_component_p (vr->operands)
&& !contains_storage_order_barrier_p (vr->operands)
&& gimple_assign_single_p (def_stmt)
+ && !TREE_THIS_VOLATILE (gimple_assign_lhs (def_stmt))
&& CHAR_BIT == 8
&& BITS_PER_UNIT == 8
&& BYTES_BIG_ENDIAN == WORDS_BIG_ENDIAN
&& !reverse_storage_order_for_component_p (vr->operands)
&& !contains_storage_order_barrier_p (vr->operands)
&& gimple_assign_single_p (def_stmt)
+ && !TREE_THIS_VOLATILE (gimple_assign_lhs (def_stmt))
&& TREE_CODE (gimple_assign_rhs1 (def_stmt)) == SSA_NAME)
{
tree lhs = gimple_assign_lhs (def_stmt);
the copy kills ref. */
else if (data->vn_walk_kind == VN_WALKREWRITE
&& gimple_assign_single_p (def_stmt)
+ && !gimple_has_volatile_ops (def_stmt)
&& (DECL_P (gimple_assign_rhs1 (def_stmt))
|| TREE_CODE (gimple_assign_rhs1 (def_stmt)) == MEM_REF
|| handled_component_p (gimple_assign_rhs1 (def_stmt))))