From 8b8bba2dd98b692b749bf023abf02c245ecd2515 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Wed, 3 Nov 2010 13:30:48 +0000 Subject: re PR tree-optimization/46190 (ICE in vect_enhance_data_refs_alignment when building fma3d) 2010-11-03 Richard Guenther PR tree-optimization/46190 * tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Properly compute peel iterations. * gfortran.dg/pr46190.f90: New testcase. From-SVN: r166244 --- gcc/tree-vect-data-refs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gcc/tree-vect-data-refs.c') diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index b4da517..ce872cf 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -1518,7 +1518,8 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo) mis = DR_MISALIGNMENT (dr) / GET_MODE_SIZE (TYPE_MODE ( TREE_TYPE (DR_REF (dr)))); npeel_tmp = (negative - ? (mis - nelements) : (nelements - mis)) & (vf - 1); + ? (mis - nelements) : (nelements - mis)) + & (nelements - 1); /* For multiple types, it is possible that the bigger type access will have more than one peeling option. E.g., a loop with two @@ -1722,7 +1723,8 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo) count. */ mis = DR_MISALIGNMENT (dr0); mis /= GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (DR_REF (dr0)))); - npeel = (negative ? mis - nelements : nelements - mis) & (vf - 1); + npeel = ((negative ? mis - nelements : nelements - mis) + & (nelements - 1)); } /* For interleaved data access every iteration accesses all the -- cgit v1.1