diff options
author | Richard Biener <rguenther@suse.de> | 2015-12-14 13:42:03 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2015-12-14 13:42:03 +0000 |
commit | 60f2b864499470fd9a656e771191222dcaee5a4c (patch) | |
tree | 7341fb2f9c43b8fc3720b2ffcaa041931d9989ec /gcc | |
parent | adb48173b8a6e7cba100e890c0ec60a9fb2188c6 (diff) | |
download | gcc-60f2b864499470fd9a656e771191222dcaee5a4c.zip gcc-60f2b864499470fd9a656e771191222dcaee5a4c.tar.gz gcc-60f2b864499470fd9a656e771191222dcaee5a4c.tar.bz2 |
re PR tree-optimization/68775 (spec2006 test case 465.tonto fails with the gcc 6.0 fortran compiler)
2015-12-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/68775
* tree-vect-slp.c (vect_build_slp_tree): Make sure to apply
a operand swapping even if replacing the op with scalars.
From-SVN: r231617
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/tree-vect-slp.c | 25 |
2 files changed, 20 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c79b65c..abffbd7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-12-14 Richard Biener <rguenther@suse.de> + + PR tree-optimization/68775 + * tree-vect-slp.c (vect_build_slp_tree): Make sure to apply + a operand swapping even if replacing the op with scalars. + 2015-12-14 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * combine.c (change_zero_ext): Do not create a shift of zero length. diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index 5be2f90..d355919 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -1044,6 +1044,20 @@ vect_build_slp_tree (vec_info *vinfo, tem, npermutes, &this_tree_size, max_tree_size)) { + /* ... so if successful we can apply the operand swapping + to the GIMPLE IL. This is necessary because for example + vect_get_slp_defs uses operand indexes and thus expects + canonical operand order. This is also necessary even + if we end up building the operand from scalars as + we'll continue to process swapped operand two. */ + for (j = 0; j < group_size; ++j) + if (!matches[j]) + { + gimple *stmt = SLP_TREE_SCALAR_STMTS (*node)[j]; + swap_ssa_operands (stmt, gimple_assign_rhs1_ptr (stmt), + gimple_assign_rhs2_ptr (stmt)); + } + /* If we have all children of child built up from scalars then just throw that away and build it up this node from scalars. */ if (!SLP_TREE_CHILDREN (child).is_empty ()) @@ -1073,17 +1087,6 @@ vect_build_slp_tree (vec_info *vinfo, } } - /* ... so if successful we can apply the operand swapping - to the GIMPLE IL. This is necessary because for example - vect_get_slp_defs uses operand indexes and thus expects - canonical operand order. */ - for (j = 0; j < group_size; ++j) - if (!matches[j]) - { - gimple *stmt = SLP_TREE_SCALAR_STMTS (*node)[j]; - swap_ssa_operands (stmt, gimple_assign_rhs1_ptr (stmt), - gimple_assign_rhs2_ptr (stmt)); - } oprnd_info->def_stmts = vNULL; SLP_TREE_CHILDREN (*node).quick_push (child); continue; |