diff options
author | Jakub Jelinek <jakub@redhat.com> | 2015-03-24 11:45:09 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2015-03-24 11:45:09 +0100 |
commit | e72baed7e945f47609207ec8be4994e586e70649 (patch) | |
tree | c3d4d2a9189cb110c596b2d57551573492b86299 /gcc | |
parent | 34d9d74996badd2b9ee315903f916ebb7a8d422f (diff) | |
download | gcc-e72baed7e945f47609207ec8be4994e586e70649.zip gcc-e72baed7e945f47609207ec8be4994e586e70649.tar.gz gcc-e72baed7e945f47609207ec8be4994e586e70649.tar.bz2 |
re PR tree-optimization/65533 (252.eon in SPEC CPU 2000 failed to build)
PR tree-optimization/65533
* tree-vect-slp.c (vect_build_slp_tree): Before re-trying
with swapped operands, call vect_free_slp_tree on
SLP_TREE_CHILDREN of child and truncate the SLP_TREE_CHILDREN
vector.
* gcc.dg/pr65533.c: New test.
From-SVN: r221622
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr65533.c | 25 | ||||
-rw-r--r-- | gcc/tree-vect-slp.c | 9 |
4 files changed, 46 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 94643fe..262fded 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2015-03-24 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/65533 + * tree-vect-slp.c (vect_build_slp_tree): Before re-trying + with swapped operands, call vect_free_slp_tree on + SLP_TREE_CHILDREN of child and truncate the SLP_TREE_CHILDREN + vector. + 2015-03-24 Richard Biener <rguenther@suse.de> PR middle-end/65517 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6049784..a1ad9e9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-03-24 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/65533 + * gcc.dg/pr65533.c: New test. + 2015-03-24 Andre Vehreschild <vehre@gmx.de> * gfortran.dg/allocate_alloc_opt_13.f90: Added tests for diff --git a/gcc/testsuite/gcc.dg/pr65533.c b/gcc/testsuite/gcc.dg/pr65533.c new file mode 100644 index 0000000..49edf15 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr65533.c @@ -0,0 +1,25 @@ +/* PR tree-optimization/65533 */ +/* { dg-do compile } */ +/* { dg-options "-Ofast -w" } */ + +struct A { int a[2]; }; +struct B { double b[2]; }; +struct C { double c[4][1]; }; + +static inline void +bar (struct B *x, double y, double z) +{ + x->b[0] = y; + x->b[1] = z; +} + +void baz (struct B *); + +void +foo (struct C *x, struct A *y) +{ + struct B d; + bar (&d, x->c[1][0] * y->a[0] + x->c[0][1] * y->a[1] + x->c[0][0] * x->c[0][1], + x->c[0][0] * y->a[0] + x->c[0][1] * y->a[1] + x->c[0][1] * y->a[0] + x->c[0][0]); + baz (&d); +} diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index c57a5ca..73ab24e 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -1035,13 +1035,20 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, behavior. */ && *npermutes < 4) { + unsigned int j; + slp_tree grandchild; + /* Roll back. */ *max_nunits = old_max_nunits; loads->truncate (old_nloads); + FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (child), j, grandchild) + vect_free_slp_tree (grandchild); + SLP_TREE_CHILDREN (child).truncate (0); + /* Swap mismatched definition stmts. */ dump_printf_loc (MSG_NOTE, vect_location, "Re-trying with swapped operands of stmts "); - for (unsigned j = 0; j < group_size; ++j) + for (j = 0; j < group_size; ++j) if (!matches[j]) { gimple tem = oprnds_info[0]->def_stmts[j]; |