aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2018-01-04 18:04:54 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2018-01-04 18:04:54 +0000
commit88654ce63de73fc51a47e7d54070c2c0b6b2f34b (patch)
tree9732cb980f4e57e448cbc8c18b82318479bdde0e
parent64d620ef974744e0760111c379d53a39094442d7 (diff)
downloadgcc-88654ce63de73fc51a47e7d54070c2c0b6b2f34b.zip
gcc-88654ce63de73fc51a47e7d54070c2c0b6b2f34b.tar.gz
gcc-88654ce63de73fc51a47e7d54070c2c0b6b2f34b.tar.bz2
Allow VEC_PERM_EXPR folding to fail
tree-ssa-forwprop.c was asserting that a VEC_PERM_EXPR fold on three VECTOR_CSTs would always succeed, but it's possible for it to fail with variable-length vectors. 2017-12-22 Richard Sandiford <richard.sandiford@linaro.org> gcc/ * tree-ssa-forwprop.c (is_combined_permutation_identity): Allow the VEC_PERM_EXPR fold to fail. From-SVN: r256257
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree-ssa-forwprop.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 622d648..64326df 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2018-01-04 Richard Sandiford <richard.sandiford@linaro.org>
+
+ * tree-ssa-forwprop.c (is_combined_permutation_identity): Allow
+ the VEC_PERM_EXPR fold to fail.
+
2018-01-04 Jakub Jelinek <jakub@redhat.com>
PR debug/83585
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index 1aad176..58ec6b4 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -1865,7 +1865,8 @@ is_combined_permutation_identity (tree mask1, tree mask2)
gcc_checking_assert (TREE_CODE (mask1) == VECTOR_CST
&& TREE_CODE (mask2) == VECTOR_CST);
mask = fold_ternary (VEC_PERM_EXPR, TREE_TYPE (mask1), mask1, mask1, mask2);
- gcc_assert (TREE_CODE (mask) == VECTOR_CST);
+ if (mask == NULL_TREE || TREE_CODE (mask) != VECTOR_CST)
+ return 0;
if (!VECTOR_CST_NELTS (mask).is_constant (&nelts))
return 0;