Hi!

The r16-5095 PR122065 change added build_int_cst call on vector types.
That is never correct, it ICEs already on the TYPE_PRECISION used at the
start of wide_int_to_tree_1.

Fixed by using build_zero_cst instead.

Bootstrapped/regtested on x86_64-linux, i686-linux and aarch64-linux, ok for
trunk?

2025-12-10  Jakub Jelinek  <[email protected]>
            Andrew Pinski  <[email protected]>

        PR middle-end/123069
        * tree-vect-generic.cc (expand_vector_mult): Use
        build_zero_cst (vectype) instead of build_int_cst (vectype, 0).

        * gcc.c-torture/compile/pr123069.c: New test.

--- gcc/tree-vect-generic.cc.jj 2025-11-08 08:27:58.091108303 +0100
+++ gcc/tree-vect-generic.cc    2025-12-09 11:17:09.029251748 +0100
@@ -627,7 +627,7 @@ expand_vector_mult (gimple_stmt_iterator
        }
       tree accumulator, tmp_var;
       if (alg.op[0] == alg_zero)
-       accumulator = build_int_cst (vectype, 0);
+       accumulator = build_zero_cst (vectype);
       else
        accumulator = op0;
 
--- gcc/testsuite/gcc.c-torture/compile/pr123069.c.jj   2025-12-09 
11:14:29.064998117 +0100
+++ gcc/testsuite/gcc.c-torture/compile/pr123069.c      2025-12-09 
11:14:12.474282957 +0100
@@ -0,0 +1,9 @@
+/* PR middle-end/123069 */
+
+__attribute__((__vector_size__ (2 * sizeof (long long)))) unsigned long long v;
+
+void
+foo (void)
+{
+  v *= 0xffffffff00000000ULL;
+}

        Jakub

Reply via email to