diff options
author | Zdenek Dvorak <dvorakz@suse.cz> | 2004-11-14 19:04:25 +0100 |
---|---|---|
committer | Zdenek Dvorak <rakdver@gcc.gnu.org> | 2004-11-14 18:04:25 +0000 |
commit | 9beeb4ee4c1bf42a2d3a66d75d250cf20c9c1f9f (patch) | |
tree | 4342616d30f20c349279f331a6f1ad5af6c0e53b /gcc/tree-ssa-loop-im.c | |
parent | 3021a627c59f88450a6c785d5b0d61f390762445 (diff) | |
download | gcc-9beeb4ee4c1bf42a2d3a66d75d250cf20c9c1f9f.zip gcc-9beeb4ee4c1bf42a2d3a66d75d250cf20c9c1f9f.tar.gz gcc-9beeb4ee4c1bf42a2d3a66d75d250cf20c9c1f9f.tar.bz2 |
re PR tree-optimization/18431 (Code for arrays and pointers are not the same)
PR tree-optimization/18431
* tree-flow.h (stmt_references_memory_p): Declare.
* tree-ssa-loop-im.c (stmt_cost): Use stmt_references_memory_p.
* tree-ssa.c (stmt_references_memory_p): New function.
From-SVN: r90624
Diffstat (limited to 'gcc/tree-ssa-loop-im.c')
-rw-r--r-- | gcc/tree-ssa-loop-im.c | 4 |
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)) |