vect_prepare_for_masked_peels currently obtains the type used
for alignment calculations from `LOOP_VINFO_NITERS'. However,
uncounted loops do not have an available scalar iteration count,
so this expression cannot be used for such loops.
Use sizetype for uncounted loops, while retaining the type of
`LOOP_VINFO_NITERS' for counted loops.
This allows the masked peeling preparation to handle uncounted
loops without depending on the availability of a scalar
iteration count.
gcc/ChangeLog:
* tree-vect-loop-manip.cc (vect_prepare_for_masked_peels):
Use sizetype for uncounted loops.
---
gcc/tree-vect-loop-manip.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gcc/tree-vect-loop-manip.cc b/gcc/tree-vect-loop-manip.cc
index 99ad5a88bb2..5e3f27578f3 100644
--- a/gcc/tree-vect-loop-manip.cc
+++ b/gcc/tree-vect-loop-manip.cc
@@ -3045,7 +3045,8 @@ void
vect_prepare_for_masked_peels (loop_vec_info loop_vinfo)
{
tree misalign_in_elems;
- tree type = TREE_TYPE (LOOP_VINFO_NITERS (loop_vinfo));
+ tree type = LOOP_VINFO_NITERS_UNCOUNTED_P (loop_vinfo)
+ ? sizetype : TREE_TYPE (LOOP_VINFO_NITERS (loop_vinfo));
gcc_assert (vect_use_loop_mask_for_alignment_p (loop_vinfo));
--
2.43.0