aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/base/pr116351-1.c5
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/base/pr116351-2.c5
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/base/pr116351.h18
-rw-r--r--gcc/tree-vect-loop.cc3
4 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/pr116351-1.c b/gcc/testsuite/gcc.target/riscv/rvv/base/pr116351-1.c
new file mode 100644
index 0000000..f58fedf
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/pr116351-1.c
@@ -0,0 +1,5 @@
+/* Test that we do not have ice when compile */
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gc_zve32x -mabi=lp64d -O3 -ftree-vectorize" } */
+
+#include "pr116351.h"
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/pr116351-2.c b/gcc/testsuite/gcc.target/riscv/rvv/base/pr116351-2.c
new file mode 100644
index 0000000..e1f46b7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/pr116351-2.c
@@ -0,0 +1,5 @@
+/* Test that we do not have ice when compile */
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gc_zve32f -mabi=lp64d -O3 -ftree-vectorize" } */
+
+#include "pr116351.h"
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/pr116351.h b/gcc/testsuite/gcc.target/riscv/rvv/base/pr116351.h
new file mode 100644
index 0000000..25bd0ec
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/pr116351.h
@@ -0,0 +1,18 @@
+#ifndef PR116351_H
+#define PR116351_H
+
+#define T long
+
+int a, b, c;
+short d, e, f;
+
+T g (T h) { return h; }
+
+void i () {
+ for (; b; ++b) {
+ f = 5 >> a ? d : d << a;
+ e &= c | g(f);
+ }
+}
+
+#endif
diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index 07b19a2..b279ebe 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -1562,6 +1562,9 @@ vect_verify_loop_lens (loop_vec_info loop_vinfo)
if (LOOP_VINFO_LENS (loop_vinfo).is_empty ())
return false;
+ if (!VECTOR_MODE_P (loop_vinfo->vector_mode))
+ return false;
+
machine_mode len_load_mode, len_store_mode;
if (!get_len_load_store_mode (loop_vinfo->vector_mode, true)
.exists (&len_load_mode))