aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 6c13d6d..98eb55e 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -8927,9 +8927,11 @@ static tree
fold_vec_perm (tree type, tree arg0, tree arg1, const vec_perm_indices &sel)
{
unsigned int i;
+ unsigned HOST_WIDE_INT nelts;
bool need_ctor = false;
- unsigned int nelts = sel.length ();
+ if (!sel.length ().is_constant (&nelts))
+ return NULL_TREE;
gcc_assert (TYPE_VECTOR_SUBPARTS (type) == nelts
&& TYPE_VECTOR_SUBPARTS (TREE_TYPE (arg0)) == nelts
&& TYPE_VECTOR_SUBPARTS (TREE_TYPE (arg1)) == nelts);