aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-phiopt.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-phiopt.c')
-rw-r--r--gcc/tree-ssa-phiopt.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c
index 697e33cf5b8..eee497296ca 100644
--- a/gcc/tree-ssa-phiopt.c
+++ b/gcc/tree-ssa-phiopt.c
@@ -1342,7 +1342,7 @@ nt_init_block (struct dom_walk_data *data ATTRIBUTE_UNUSED, basic_block bb)
{
gimple stmt = gsi_stmt (gsi);
- if (gimple_assign_single_p (stmt))
+ if (gimple_assign_single_p (stmt) && !gimple_has_volatile_ops (stmt))
{
add_or_mark_expr (bb, gimple_assign_lhs (stmt), nontrap_set, true);
add_or_mark_expr (bb, gimple_assign_rhs1 (stmt), nontrap_set, false);
@@ -1419,7 +1419,8 @@ cond_store_replacement (basic_block middle_bb, basic_block join_bb,
/* Check if middle_bb contains of only one store. */
if (!assign
- || !gimple_assign_single_p (assign))
+ || !gimple_assign_single_p (assign)
+ || gimple_has_volatile_ops (assign))
return false;
locus = gimple_location (assign);
@@ -1490,9 +1491,11 @@ cond_if_else_store_replacement_1 (basic_block then_bb, basic_block else_bb,
if (then_assign == NULL
|| !gimple_assign_single_p (then_assign)
|| gimple_clobber_p (then_assign)
+ || gimple_has_volatile_ops (then_assign)
|| else_assign == NULL
|| !gimple_assign_single_p (else_assign)
- || gimple_clobber_p (else_assign))
+ || gimple_clobber_p (else_assign)
+ || gimple_has_volatile_ops (else_assign))
return false;
lhs = gimple_assign_lhs (then_assign);
@@ -1829,7 +1832,9 @@ hoist_adjacent_loads (basic_block bb0, basic_block bb1,
/* Both statements must be assignments whose RHS is a COMPONENT_REF. */
if (!gimple_assign_single_p (def1)
- || !gimple_assign_single_p (def2))
+ || !gimple_assign_single_p (def2)
+ || gimple_has_volatile_ops (def1)
+ || gimple_has_volatile_ops (def2))
continue;
ref1 = gimple_assign_rhs1 (def1);