I was mistaken in that npeel is -1 for variable peeling - it is 0.

Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.

2021-09-30  Richard Biener  <rguent...@suse.de>

        * tree-vect-data-refs.c (vect_update_misalignment_for_peel):
        Fix npeel check for variable amount of peeling.
---
 gcc/tree-vect-data-refs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index 1c6fc4a8f0f..bece58df3bf 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -1265,7 +1265,7 @@ vect_update_misalignment_for_peel (dr_vec_info *dr_info,
   tree vectype = STMT_VINFO_VECTYPE (dr_info->stmt);
   if (DR_TARGET_ALIGNMENT (dr_info).is_constant (&alignment)
       && known_alignment_for_access_p (dr_info, vectype)
-      && npeel != -1)
+      && npeel != 0)
     {
       int misal = dr_info->misalignment;
       misal += npeel * TREE_INT_CST_LOW (DR_STEP (dr_info->dr));
-- 
2.31.1

Reply via email to