re PR middle-end/78684 (ICE in create_intersect_range_checks_index, at tree-vect...
authorBin Cheng <bin.cheng@arm.com>
Thu, 8 Dec 2016 10:56:41 +0000 (10:56 +0000)
committerBin Cheng <amker@gcc.gnu.org>
Thu, 8 Dec 2016 10:56:41 +0000 (10:56 +0000)
PR middle-end/78684
* tree-vect-loop-manip.c (create_intersect_range_checks_index): Check
sign bit for index step of data reference.
gcc/testsuite
PR middle-end/78684
* g++.dg/torture/pr78684.C: New test.

From-SVN: r243431

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/torture/pr78684.C [new file with mode: 0644]
gcc/tree-vect-loop-manip.c

index 20262613f7a0681a1a1170a13ca8993caa62a63a..91a1ed3562d32dae56f5f7c8faeb4104e60bac14 100644 (file)
@@ -1,3 +1,9 @@
+2016-12-08  Bin Cheng  <bin.cheng@arm.com>
+
+       PR middle-end/78684
+       * tree-vect-loop-manip.c (create_intersect_range_checks_index): Check
+       sign bit for index step of data reference.
+
 2016-12-08  Naveen H.S  <Naveen.Hurugalawadi@cavium.com>
 
        * config/aarch64/aarch64.c (aarch64_load_symref_appropriately):
index c7d27734fa5b2041ee7a7055ea1d0ce29dab10d4..904d74fe325cba327b567e9397e65f5cd2a797d3 100644 (file)
@@ -1,3 +1,8 @@
+2016-12-08  Bin Cheng  <bin.cheng@arm.com>
+
+       PR middle-end/78684
+       * g++.dg/torture/pr78684.C: New test.
+
 2016-12-08  Christophe Lyon  <christophe.lyon@linaro.org>
 
        * gcc.target/aarch64/advsimd-intrinsics/arm-neon-ref.h
diff --git a/gcc/testsuite/g++.dg/torture/pr78684.C b/gcc/testsuite/g++.dg/torture/pr78684.C
new file mode 100644 (file)
index 0000000..5d71be5
--- /dev/null
@@ -0,0 +1,20 @@
+// PR middle-end/78684
+// { dg-do compile }
+
+class a {
+public:
+  a(long);
+  void operator<<=(long) {
+    long b;
+    for (unsigned long c; c; c--)
+      d[c + b] = d[c];
+  }
+  a &g();
+  long d[28];
+};
+long e;
+int f;
+void j() {
+  a h(e), i = h;
+  i.g() <<= f;
+}
index e13d6a2758b9af86182a74a4d5c69f113fc20161..beb2f066583485242b7a947307dcef4f57adff54 100644 (file)
@@ -2070,8 +2070,7 @@ create_intersect_range_checks_index (loop_vec_info loop_vinfo, tree *cond_expr,
       /* Index must have const step, otherwise DR_STEP won't be constant.  */
       gcc_assert (TREE_CODE (idx_step) == INTEGER_CST);
       /* Index must evaluate in the same direction as DR.  */
-      gcc_assert (!neg_step
-                 || tree_int_cst_compare (idx_step, size_zero_node) < 0);
+      gcc_assert (!neg_step || tree_int_cst_sign_bit (idx_step) == 1);
 
       tree min1 = CHREC_LEFT (access1);
       tree min2 = CHREC_LEFT (access2);