aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 257ddfc..f278eb2 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -4961,9 +4961,11 @@ expand_debug_expr (tree exp)
case VECTOR_CST:
{
- unsigned i, nelts;
+ unsigned HOST_WIDE_INT i, nelts;
+
+ if (!VECTOR_CST_NELTS (exp).is_constant (&nelts))
+ return NULL;
- nelts = VECTOR_CST_NELTS (exp);
op0 = gen_rtx_CONCATN (mode, rtvec_alloc (nelts));
for (i = 0; i < nelts; ++i)
@@ -4983,10 +4985,13 @@ expand_debug_expr (tree exp)
else if (TREE_CODE (TREE_TYPE (exp)) == VECTOR_TYPE)
{
unsigned i;
+ unsigned HOST_WIDE_INT nelts;
tree val;
- op0 = gen_rtx_CONCATN
- (mode, rtvec_alloc (TYPE_VECTOR_SUBPARTS (TREE_TYPE (exp))));
+ if (!TYPE_VECTOR_SUBPARTS (TREE_TYPE (exp)).is_constant (&nelts))
+ goto flag_unsupported;
+
+ op0 = gen_rtx_CONCATN (mode, rtvec_alloc (nelts));
FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (exp), i, val)
{
@@ -4996,7 +5001,7 @@ expand_debug_expr (tree exp)
XVECEXP (op0, 0, i) = op1;
}
- if (i < TYPE_VECTOR_SUBPARTS (TREE_TYPE (exp)))
+ if (i < nelts)
{
op1 = expand_debug_expr
(build_zero_cst (TREE_TYPE (TREE_TYPE (exp))));
@@ -5004,7 +5009,7 @@ expand_debug_expr (tree exp)
if (!op1)
return NULL;
- for (; i < TYPE_VECTOR_SUBPARTS (TREE_TYPE (exp)); i++)
+ for (; i < nelts; i++)
XVECEXP (op0, 0, i) = op1;
}