re PR tree-optimization/87917 (ICE in initialize_matrix_A at gcc/tree-data-ref.c...
authorRichard Biener <rguenther@suse.de>
Thu, 15 Nov 2018 08:16:22 +0000 (08:16 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 15 Nov 2018 08:16:22 +0000 (08:16 +0000)
2018-11-15  Richard Biener  <rguenther@suse.de>

PR middle-end/87917
* tree-data-ref.c (analyze_miv_subscript): Guard calls to
analyze_subscript_affine_affine properly.

* gcc.dg/tree-ssa/pr87917.c: New testcase.

From-SVN: r266173

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/pr87917.c [new file with mode: 0644]
gcc/tree-data-ref.c

index 6b1fd33e71856bf18378192e34e77ef7c41af7bc..174ee432c4fa98f668517c5d7be7d97f0faeb810 100644 (file)
@@ -1,3 +1,9 @@
+2018-11-15  Richard Biener  <rguenther@suse.de>
+
+       PR middle-end/87917
+       * tree-data-ref.c (analyze_miv_subscript): Guard calls to
+       analyze_subscript_affine_affine properly.
+
 2018-11-15  Xianmiao Qu  <xianmiao_qu@c-sky.com>
 
        * config/csky/csky-linux-elf.h (LINUX_DYNAMIC_LINKER): Remove.
index a5dfd90de4947645d40a4589f86327e1bdec4ec2..0bcd8e0711f4ca9467a0351266a55995ef473855 100644 (file)
@@ -1,3 +1,8 @@
+2018-11-15  Richard Biener  <rguenther@suse.de>
+
+       PR middle-end/87917
+       * gcc.dg/tree-ssa/pr87917.c: New testcase.
+
 2018-11-15  Bin Cheng  <bin.cheng@linux.alibaba.com>
 
        PR tree-optimization/84648
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr87917.c b/gcc/testsuite/gcc.dg/tree-ssa/pr87917.c
new file mode 100644 (file)
index 0000000..2f3862a
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribute-patterns -ftrapv -fno-tree-fre" } */
+
+void foo(int x[])
+{
+ int i, j;
+
+ for (i = 0; i < 2; i++)
+   for (j = 0; j < 2; j++)
+   {
+     x[i] = x[i*j];
+     x[i] = x[i*j];
+   }
+}
index 1fe32365887f6aacc7fdf5b6fdfdd32fd79136bf..ca07bdf7845fefdd37d819c3908f4559ba25cc01 100644 (file)
@@ -4038,9 +4038,9 @@ analyze_miv_subscript (tree chrec_a,
       dependence_stats.num_miv_independent++;
     }
 
-  else if (evolution_function_is_affine_multivariate_p (chrec_a, loop_nest->num)
+  else if (evolution_function_is_affine_in_loop (chrec_a, loop_nest->num)
           && !chrec_contains_symbols (chrec_a)
-          && evolution_function_is_affine_multivariate_p (chrec_b, loop_nest->num)
+          && evolution_function_is_affine_in_loop (chrec_b, loop_nest->num)
           && !chrec_contains_symbols (chrec_b))
     {
       /* testsuite/.../ssa-chrec-35.c