aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-im.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-loop-im.c')
-rw-r--r--gcc/tree-ssa-loop-im.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c
index d04d095..3c75553 100644
--- a/gcc/tree-ssa-loop-im.c
+++ b/gcc/tree-ssa-loop-im.c
@@ -365,9 +365,7 @@ stmt_cost (tree stmt)
rhs = TREE_OPERAND (stmt, 1);
/* Hoisting memory references out should almost surely be a win. */
- if (!is_gimple_variable (lhs))
- cost += 20;
- if (is_gimple_addressable (rhs) && !is_gimple_variable (rhs))
+ if (stmt_references_memory_p (stmt))
cost += 20;
switch (TREE_CODE (rhs))