]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-optimization/119858 - type mismatch with POINTER_PLUS
authorRichard Biener <rguenther@suse.de>
Fri, 18 Apr 2025 12:52:41 +0000 (14:52 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 18 Apr 2025 14:13:24 +0000 (16:13 +0200)
The recent PFA early-break vectorization fix left us with a POINTER_PLUS
and non-sizetype offset.

PR tree-optimization/119858
* tree-vect-loop.cc (vectorizable_live_operation): Convert
pointer offset to sizetype.

gcc/tree-vect-loop.cc

index 958b829fa8d1ad267fbde3be915719f3a51e6a38..2d35fa128864a555cb07c2691c2cb634b7b15c6d 100644 (file)
@@ -11657,8 +11657,12 @@ vectorizable_live_operation (vec_info *vinfo, stmt_vec_info stmt_info,
                                    break_lhs_phi);
 
                  if (POINTER_TYPE_P (TREE_TYPE (new_tree)))
-                   tmp2 = gimple_build (&iv_stmts, POINTER_PLUS_EXPR,
-                                        TREE_TYPE (new_tree), new_tree, tmp2);
+                   {
+                     tmp2 = gimple_convert (&iv_stmts, sizetype, tmp2);
+                     tmp2 = gimple_build (&iv_stmts, POINTER_PLUS_EXPR,
+                                          TREE_TYPE (new_tree), new_tree,
+                                          tmp2);
+                   }
                  else
                    {
                      tmp2 = gimple_convert (&iv_stmts, TREE_TYPE (new_tree),