re PR tree-optimization/68817 (internal compiler error: Segmentation fault (program...
authorRichard Biener <rguenther@suse.de>
Thu, 10 Dec 2015 13:23:22 +0000 (13:23 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 10 Dec 2015 13:23:22 +0000 (13:23 +0000)
2015-12-10  Richard Biener  <rguenther@suse.de>

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
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr68817.f90 [new file with mode: 0644]
gcc/tree-vect-slp.c

index e68d68876790cf1a4718c2da683d9936802a5448..13f41540643c60cc3257e58eaa620ed541b2c038 100644 (file)
@@ -1,3 +1,9 @@
+2015-12-10  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/68817
+       * tree-vect-slp.c (vect_attempt_slp_rearrange_stmts): Detect
+       gaps early.
+
 2015-12-10  Ilya Enkovich  <enkovich.gnu@gmail.com>
 
        * tree-vect-stmts.c (vectorizable_assignment): Support
index 499ec0da6544aaa89ac3dfc1f20c875afdab34fa..40bfb454567c713ac6c5e50068a50d6cb373cffc 100644 (file)
@@ -1,3 +1,8 @@
+2015-12-10  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/68817
+       * gfortran.dg/pr68817.f90: New testcase.
+
 2015-12-10  Christophe Lyon  <christophe.lyon@linaro.org>
 
        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 (file)
index 0000000..606b430
--- /dev/null
@@ -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
+
index b893682306762411adbc87f24e0245b6824fa161..5be2f90730d347ea3b92b0edfab6a3b2694a063f 100644 (file)
@@ -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);