diff options
author | Tamar Christina <tamar.christina@arm.com> | 2021-12-17 10:59:25 +0000 |
---|---|---|
committer | Tamar Christina <tamar.christina@arm.com> | 2021-12-17 10:59:33 +0000 |
commit | 411ac94611f164fac7ec1cd5953549c0a56cf43a (patch) | |
tree | 3ee42ce679f2ff1b2d227e42c686313bc0022eef /gcc/tree-vect-stmts.c | |
parent | 574c09da48a5a0ff4c32dd4577eaf65bac8c94a0 (diff) | |
download | gcc-411ac94611f164fac7ec1cd5953549c0a56cf43a.zip gcc-411ac94611f164fac7ec1cd5953549c0a56cf43a.tar.gz gcc-411ac94611f164fac7ec1cd5953549c0a56cf43a.tar.bz2 |
slp: check that the operation we're combing is a boolean operation [PR103741]
It seems I forgot to check that the operation we're combing when masking the
predicated together are actually predicates types.
Without it we end up accidentally trying to combine a value and a mask.
gcc/ChangeLog:
PR tree-optimization/103741
* tree-vect-stmts.c (vectorizable_operation): Check for boolean.
gcc/testsuite/ChangeLog:
PR tree-optimization/103741
* gcc.target/aarch64/pr103741.c: New test.
Diffstat (limited to 'gcc/tree-vect-stmts.c')
-rw-r--r-- | gcc/tree-vect-stmts.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 8c42717..ad90cdb 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -6361,7 +6361,9 @@ vectorizable_operation (vec_info *vinfo, /* When combining two masks check if either of them is elsewhere combined with a loop mask, if that's the case we can mark that the new combined mask doesn't need to be combined with a loop mask. */ - if (masked_loop_p && code == BIT_AND_EXPR) + if (masked_loop_p + && code == BIT_AND_EXPR + && VECTOR_BOOLEAN_TYPE_P (vectype)) { if (loop_vinfo->scalar_cond_masked_set.contains ({ op0, ncopies})) |