diff options
author | Richard Guenther <rguenther@suse.de> | 2010-07-04 16:08:21 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-07-04 16:08:21 +0000 |
commit | 17fc049f3443386e244e5be2274f507809153634 (patch) | |
tree | 59e80ed510f8ae3365e1b7da08565e3b031f12d9 /gcc/tree-ssa-loop-ivopts.c | |
parent | c9dfc4144a464f1ee0306ff388ee85e2c178f18c (diff) | |
download | gcc-17fc049f3443386e244e5be2274f507809153634.zip gcc-17fc049f3443386e244e5be2274f507809153634.tar.gz gcc-17fc049f3443386e244e5be2274f507809153634.tar.bz2 |
re PR rtl-optimization/44479 (false dependencies are computed after vectorization)
2010-07-04 Richard Guenther <rguenther@suse.de>
PR tree-optimization/44479
* tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Avoid
extra SSA name copy statements which preserves points-to
information.
* tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref):
Copy points-to information for all pointers. Properly handle
MEM_REFs.
(vect_create_data_ref_ptr): Likewise. Avoid extra SSA name
copy statements.
* Makefile.in (tree-ssa-loop-ivopts.o): Add tree-ssa-propagate.h
dependency.
From-SVN: r161802
Diffstat (limited to 'gcc/tree-ssa-loop-ivopts.c')
-rw-r--r-- | gcc/tree-ssa-loop-ivopts.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index 02677fa..b7b26a3 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -89,6 +89,7 @@ along with GCC; see the file COPYING3. If not see #include "langhooks.h" #include "tree-affine.h" #include "target.h" +#include "tree-ssa-propagate.h" /* FIXME: Expressions are expanded to RTL in this pass to determine the cost of different addressing modes. This should be moved to a TBD @@ -5481,12 +5482,18 @@ rewrite_use_nonlinear_expr (struct ivopts_data *data, gcc_unreachable (); } - op = force_gimple_operand_gsi (&bsi, comp, false, SSA_NAME_VAR (tgt), - true, GSI_SAME_STMT); + if (!valid_gimple_rhs_p (comp) + || (gimple_code (use->stmt) != GIMPLE_PHI + /* We can't allow re-allocating the stmt as it might be pointed + to still. */ + && (get_gimple_rhs_num_ops (TREE_CODE (comp)) + >= gimple_num_ops (gsi_stmt (bsi))))) + comp = force_gimple_operand_gsi (&bsi, comp, false, SSA_NAME_VAR (tgt), + true, GSI_SAME_STMT); if (gimple_code (use->stmt) == GIMPLE_PHI) { - ass = gimple_build_assign (tgt, op); + ass = gimple_build_assign (tgt, comp); gsi_insert_before (&bsi, ass, GSI_SAME_STMT); bsi = gsi_for_stmt (use->stmt); @@ -5494,7 +5501,7 @@ rewrite_use_nonlinear_expr (struct ivopts_data *data, } else { - gimple_assign_set_rhs_from_tree (&bsi, op); + gimple_assign_set_rhs_from_tree (&bsi, comp); use->stmt = gsi_stmt (bsi); } } |