From a5b03f2a17a7d41380de232bae2ab4800015407f Mon Sep 17 00:00:00 2001 From: Bin Cheng Date: Thu, 8 Dec 2016 10:56:41 +0000 Subject: [PATCH] re PR middle-end/78684 (ICE in create_intersect_range_checks_index, at tree-vect-loop-manip.c:2074) 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 | 6 ++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/torture/pr78684.C | 20 ++++++++++++++++++++ gcc/tree-vect-loop-manip.c | 3 +-- 4 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/g++.dg/torture/pr78684.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 20262613f7a..91a1ed3562d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-12-08 Bin Cheng + + 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 * config/aarch64/aarch64.c (aarch64_load_symref_appropriately): diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c7d27734fa5..904d74fe325 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-12-08 Bin Cheng + + PR middle-end/78684 + * g++.dg/torture/pr78684.C: New test. + 2016-12-08 Christophe Lyon * 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 index 00000000000..5d71be5fce4 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr78684.C @@ -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; +} diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c index e13d6a2758b..beb2f066583 100644 --- a/gcc/tree-vect-loop-manip.c +++ b/gcc/tree-vect-loop-manip.c @@ -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); -- 2.30.2