aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/constexpr.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2018-02-22 17:50:37 -0500
committerJason Merrill <jason@gcc.gnu.org>2018-02-22 17:50:37 -0500
commit6f11ddd8b7dc020545d0d0e8ae20d34b83265ff6 (patch)
tree77c560e22438f93739f3c458d857d12564ee7776 /gcc/cp/constexpr.c
parent8304bcf24a2d301044a881438221841cf09444d7 (diff)
downloadgcc-6f11ddd8b7dc020545d0d0e8ae20d34b83265ff6.zip
gcc-6f11ddd8b7dc020545d0d0e8ae20d34b83265ff6.tar.gz
gcc-6f11ddd8b7dc020545d0d0e8ae20d34b83265ff6.tar.bz2
PR c++/84424 - ICE with constexpr and __builtin_shuffle.
* constexpr.c (reduced_constant_expression_p): Handle CONSTRUCTOR of VECTOR_TYPE. From-SVN: r257924
Diffstat (limited to 'gcc/cp/constexpr.c')
-rw-r--r--gcc/cp/constexpr.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
index f095b03..47ff90c 100644
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -1763,7 +1763,13 @@ reduced_constant_expression_p (tree t)
/* And we need to handle PTRMEM_CST wrapped in a CONSTRUCTOR. */
tree idx, val, field; unsigned HOST_WIDE_INT i;
if (CONSTRUCTOR_NO_IMPLICIT_ZERO (t))
- field = next_initializable_field (TYPE_FIELDS (TREE_TYPE (t)));
+ {
+ if (TREE_CODE (TREE_TYPE (t)) == VECTOR_TYPE)
+ /* An initialized vector would have a VECTOR_CST. */
+ return false;
+ else
+ field = next_initializable_field (TYPE_FIELDS (TREE_TYPE (t)));
+ }
else
field = NULL_TREE;
FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (t), i, idx, val)