]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-optimization/123539 - signed UB in vector reduction
authorRichard Biener <rguenther@suse.de>
Mon, 12 Jan 2026 13:10:32 +0000 (14:10 +0100)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 13 Jan 2026 08:08:32 +0000 (09:08 +0100)
With previous changes I overlooked one use of vectype.

PR tree-optimization/123539
* tree-vect-loop.cc (vect_create_epilog_for_reduction):
Use the compute vectype to pun down to smaller or element
size for by-element reductions.

gcc/tree-vect-loop.cc

index 0333964175041ef924f6a8c0adc5a4484ee559c3..74eecb832e6f4a049be9dd6f46af577f57e567d0 100644 (file)
@@ -6000,7 +6000,7 @@ vect_create_epilog_for_reduction (loop_vec_info loop_vinfo,
               && (mode1 = targetm.vectorize.split_reduction (mode)) != mode)
        nunits1 = GET_MODE_NUNITS (mode1).to_constant ();
 
-      tree vectype1 = vectype;
+      tree vectype1 = compute_vectype;
       if (mode1 != mode)
        {
          vectype1 = get_related_vectype_for_scalar_type (TYPE_MODE (vectype),