aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/constexpr.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/constexpr.c')
-rw-r--r--gcc/cp/constexpr.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
index 148150b..ed4bbee 100644
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "ubsan.h"
#include "gimple-fold.h"
#include "timevar.h"
+#include "fold-const-call.h"
static bool verify_constant (tree, bool, bool *, bool *);
#define VERIFY_CONSTANT(X) \
@@ -1449,6 +1450,20 @@ cxx_eval_internal_function (const constexpr_ctx *ctx, tree t,
return cxx_eval_constant_expression (ctx, CALL_EXPR_ARG (t, 0),
false, non_constant_p, overflow_p);
+ case IFN_VEC_CONVERT:
+ {
+ tree arg = cxx_eval_constant_expression (ctx, CALL_EXPR_ARG (t, 0),
+ false, non_constant_p,
+ overflow_p);
+ if (TREE_CODE (arg) == VECTOR_CST)
+ return fold_const_call (CFN_VEC_CONVERT, TREE_TYPE (t), arg);
+ else
+ {
+ *non_constant_p = true;
+ return t;
+ }
+ }
+
default:
if (!ctx->quiet)
error_at (cp_expr_loc_or_loc (t, input_location),
@@ -5623,7 +5638,9 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now,
case IFN_SUB_OVERFLOW:
case IFN_MUL_OVERFLOW:
case IFN_LAUNDER:
+ case IFN_VEC_CONVERT:
bail = false;
+ break;
default:
break;