aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.c
diff options
context:
space:
mode:
authorIra Rosen <irar@il.ibm.com>2010-06-14 12:22:13 +0000
committerIra Rosen <irar@gcc.gnu.org>2010-06-14 12:22:13 +0000
commitc1e822d590c3841514118cc79284e466ac31125f (patch)
treeb0fa78dca1bcc6286458dff5972922cd0cf8557e /gcc/tree-vect-loop.c
parent66919db5ac195aa7fe24af68c8f75222c952145e (diff)
downloadgcc-c1e822d590c3841514118cc79284e466ac31125f.zip
gcc-c1e822d590c3841514118cc79284e466ac31125f.tar.gz
gcc-c1e822d590c3841514118cc79284e466ac31125f.tar.bz2
re PR tree-optimization/44507 (vectorization ANDs array elements together incorrectly)
PR tree-optimization/44507 * tree-vect-loop.c (get_initial_def_for_reduction): Use -1 to build initial vector for BIT_AND_EXPR. * tree-vect-slp.c (vect_get_constant_vectors): Likewise. From-SVN: r160727
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r--gcc/tree-vect-loop.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index ccddab3..3b38716 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -2871,12 +2871,15 @@ get_initial_def_for_reduction (gimple stmt, tree init_val,
*adjustment_def = init_val;
}
- if (code == MULT_EXPR || code == BIT_AND_EXPR)
+ if (code == MULT_EXPR)
{
real_init_val = dconst1;
int_init_val = 1;
}
+ if (code == BIT_AND_EXPR)
+ int_init_val = -1;
+
if (SCALAR_FLOAT_TYPE_P (scalar_type))
def_for_init = build_real (scalar_type, real_init_val);
else