diff options
author | Richard Biener <rguenther@suse.de> | 2013-03-05 09:54:29 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2013-03-05 09:54:29 +0000 |
commit | 12a43ab883305f9b997987eafaafbc76ca873bd3 (patch) | |
tree | 33e115b10984ffb5d04ca13783805d102a1c7ae1 | |
parent | db4138e3e20a776377b904b4ca1eae0c0186dbd6 (diff) | |
download | gcc-12a43ab883305f9b997987eafaafbc76ca873bd3.zip gcc-12a43ab883305f9b997987eafaafbc76ca873bd3.tar.gz gcc-12a43ab883305f9b997987eafaafbc76ca873bd3.tar.bz2 |
re PR tree-optimization/56270 (loop over array of struct float causes compiler error: segmentation fault)
2013-03-05 Richard Biener <rguenther@suse.de>
PR tree-optimization/56270
* tree-vect-slp.c (vect_schedule_slp): Clear vectorized stmts
of loads after scheduling an SLP instance.
* gcc.dg/vect/slp-38.c: New testcase.
From-SVN: r196458
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/slp-38.c | 24 | ||||
-rw-r--r-- | gcc/tree-vect-slp.c | 11 |
4 files changed, 45 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8d35977..b09e427 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-03-05 Richard Biener <rguenther@suse.de> + + PR tree-optimization/56270 + * tree-vect-slp.c (vect_schedule_slp): Clear vectorized stmts + of loads after scheduling an SLP instance. + 2013-03-05 Jakub Jelinek <jakub@redhat.com> * Makefile.in (dg_target_exps): Add aarch64.exp, epiphany.exp and diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4529bcf..6cbe85e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-03-05 Richard Biener <rguenther@suse.de> + + PR tree-optimization/56270 + * gcc.dg/vect/slp-38.c: New testcase. + 2013-03-05 Jakub Jelinek <jakub@redhat.com> PR rtl-optimization/56494 diff --git a/gcc/testsuite/gcc.dg/vect/slp-38.c b/gcc/testsuite/gcc.dg/vect/slp-38.c new file mode 100644 index 0000000..a387f5d --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-38.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ + +typedef struct { + float l, h; +} tFPinterval; + +tFPinterval X[1024]; +tFPinterval Y[1024]; +tFPinterval Z[1024]; + +void Compute(void) +{ + int d; + for (d= 0; d < 1024; d++) + { + Y[d].l= X[d].l + X[d].h; + Y[d].h= Y[d].l; + Z[d].l= X[d].l; + Z[d].h= X[d].h; + } +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 1 "vect" { target { vect_float && vect_perm } } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index 467abb5..3b2fc80 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -3141,7 +3141,8 @@ vect_schedule_slp (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo) { vec<slp_instance> slp_instances; slp_instance instance; - unsigned int i, vf; + slp_tree loads_node; + unsigned int i, j, vf; bool is_store = false; if (loop_vinfo) @@ -3160,6 +3161,14 @@ vect_schedule_slp (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo) /* Schedule the tree of INSTANCE. */ is_store = vect_schedule_slp_instance (SLP_INSTANCE_TREE (instance), instance, vf); + + /* Clear STMT_VINFO_VEC_STMT of all loads. With shared loads + between SLP instances we fail to properly initialize the + vectorized SLP stmts and confuse different load permutations. */ + FOR_EACH_VEC_ELT (SLP_INSTANCE_LOADS (instance), j, loads_node) + STMT_VINFO_VEC_STMT + (vinfo_for_stmt (SLP_TREE_SCALAR_STMTS (loads_node)[0])) = NULL; + if (dump_enabled_p ()) dump_printf_loc (MSG_NOTE, vect_location, "vectorizing stmts using SLP."); |