Don't pass booleans as mask types to simd clones (PR 92710)
authorRichard Sandiford <richard.sandiford@arm.com>
Fri, 29 Nov 2019 13:04:56 +0000 (13:04 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Fri, 29 Nov 2019 13:04:56 +0000 (13:04 +0000)
commit3edaed39583aeb49cfda7093ed4c0f9fed3fbea0
treee2a753ac0800cdc6722db8b3154fe7f9779f1e3f
parent337b04a4464eb2638c51e3608aa68511357a8189
Don't pass booleans as mask types to simd clones (PR 92710)

In this PR we assigned a vector mask type to the result of a comparison
and then tried to pass that mask type to a simd clone, which expected
a normal (non-mask) type instead.

This patch simply punts on call arguments that have a mask type.
A better fix would be to pattern-match the comparison to a COND_EXPR,
like we would if the comparison was stored to memory, but doing that
isn't gcc 9 or 10 material.

Note that this doesn't affect x86_64-linux-gnu because the ABI promotes
bool arguments to ints.

2019-11-29  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
PR tree-optimization/92710
* tree-vect-stmts.c (vectorizable_simd_clone_call): Reject
vector mask arguments.

gcc/testsuite/
PR tree-optimization/92710
* gcc.dg/vect/pr92710.c: New test.

From-SVN: r278839
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/pr92710.c [new file with mode: 0644]
gcc/tree-vect-stmts.c