From 41eefe133f91ffeead07774a8f68040135e5fe1c Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 10 Dec 2015 13:23:22 +0000 Subject: [PATCH] re PR tree-optimization/68817 (internal compiler error: Segmentation fault (program f951)) 2015-12-10 Richard Biener PR tree-optimization/68817 * tree-vect-slp.c (vect_attempt_slp_rearrange_stmts): Detect gaps early. * gfortran.dg/pr68817.f90: New testcase. From-SVN: r231508 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/pr68817.f90 | 11 +++++++++++ gcc/tree-vect-slp.c | 2 ++ 4 files changed, 24 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/pr68817.f90 diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e68d6887679..13f41540643 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-12-10 Richard Biener + + PR tree-optimization/68817 + * tree-vect-slp.c (vect_attempt_slp_rearrange_stmts): Detect + gaps early. + 2015-12-10 Ilya Enkovich * tree-vect-stmts.c (vectorizable_assignment): Support diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 499ec0da654..40bfb454567 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-12-10 Richard Biener + + PR tree-optimization/68817 + * gfortran.dg/pr68817.f90: New testcase. + 2015-12-10 Christophe Lyon Revert [testsuite][ARM target attributes] Fix effective_target tests diff --git a/gcc/testsuite/gfortran.dg/pr68817.f90 b/gcc/testsuite/gfortran.dg/pr68817.f90 new file mode 100644 index 00000000000..606b4303a1a --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr68817.f90 @@ -0,0 +1,11 @@ +! { dg-do compile } +! { dg-options "-O3 -ffast-math" } + SUBROUTINE TEST(A,B,C) + DIMENSION B(3),C(1000,10) + DO I = 1,3 + I3=I*3 + B(1) = B(1) + (C(K,I3+1)-A) + B(3) = B(3) + (C(K,I3+3)-A) + ENDDO + END + diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index b8936823067..5be2f90730d 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -1237,6 +1237,8 @@ vect_attempt_slp_rearrange_stmts (slp_instance slp_instn) bitmap_clear (load_index); FOR_EACH_VEC_ELT (node->load_permutation, i, lidx) { + if (lidx >= group_size) + return false; if (bitmap_bit_p (load_index, lidx)) { sbitmap_free (load_index); -- 2.30.2