@@ -1546,6 +1546,10 @@ (define_insn_and_split "*vwsll_zext1_trunc_<mode>"
"&& 1"
[(const_int 0)]
{
+ rtx truncated = gen_reg_rtx (<V_QUAD_TRUNC>mode);
+ emit_insn (gen_trunc<mode><v_quad_trunc>2 (truncated, operands[2]));
+ operands[2] = truncated;
+
insn_code icode = code_for_pred_vwsll (<V_DOUBLE_TRUNC>mode);
riscv_vector::emit_vlmax_insn (icode, riscv_vector::BINARY_OP, operands);
DONE;
new file mode 100644
@@ -0,0 +1,14 @@
+/* Test there is no ICE when compile. */
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv_zvbb -mabi=lp64d -O3" } */
+
+short a;
+char b;
+
+void
+test (int e[][1][1], char f[][1][1][1][1]) {
+ for (int g; b;)
+ for (;;)
+ for (int h; h < 4073709551572ULL; h += 18446744073709551612U)
+ a = f[2][2][1][4073709551612][1] << e[1][1][g];
+}
new file mode 100644
@@ -0,0 +1,10 @@
+/* Test there is no ICE when compile. */
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv_zvbb -mabi=lp64d -O3" } */
+
+void
+test (short *restrict dst, char *restrict a, int *restrict b, int n)
+{
+ for (int i = 0; i < n; i++)
+ dst[i] = a[i] << b[i];
+}