aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2018-01-02 18:27:35 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2018-01-02 18:27:35 +0000
commitb00cb3bfa50c5477347082a9450b4a63e4fee263 (patch)
tree963d6682878902655fb09b1a218b3b9537b7b594 /gcc/tree-cfg.c
parentd3867483044ae00bac6daaeac6274e95254fb991 (diff)
downloadgcc-b00cb3bfa50c5477347082a9450b4a63e4fee263.zip
gcc-b00cb3bfa50c5477347082a9450b4a63e4fee263.tar.gz
gcc-b00cb3bfa50c5477347082a9450b4a63e4fee263.tar.bz2
Use ssizetype selectors for autovectorised VEC_PERM_EXPRs
The previous patches mean that there's no reason that constant VEC_PERM_EXPRs need to have the same shape as the data inputs. This patch makes the autovectoriser use sizetype elements instead, so that indices don't get truncated for large or variable-length vectors. 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org> gcc/ * tree-cfg.c (verify_gimple_assign_ternary): Allow the size of the selector elements to be different from the data elements if the selector is a VECTOR_CST. * tree-vect-stmts.c (vect_gen_perm_mask_any): Use a vector of ssizetype for the selector. From-SVN: r256100
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index bed4947..96b638f 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -4428,8 +4428,11 @@ verify_gimple_assign_ternary (gassign *stmt)
}
if (TREE_CODE (TREE_TYPE (rhs3_type)) != INTEGER_TYPE
- || GET_MODE_BITSIZE (SCALAR_INT_TYPE_MODE (TREE_TYPE (rhs3_type)))
- != GET_MODE_BITSIZE (SCALAR_TYPE_MODE (TREE_TYPE (rhs1_type))))
+ || (TREE_CODE (rhs3) != VECTOR_CST
+ && (GET_MODE_BITSIZE (SCALAR_INT_TYPE_MODE
+ (TREE_TYPE (rhs3_type)))
+ != GET_MODE_BITSIZE (SCALAR_TYPE_MODE
+ (TREE_TYPE (rhs1_type))))))
{
error ("invalid mask type in vector permute expression");
debug_generic_expr (lhs_type);