Commit 201dd46b by Richard Henderson Committed by Richard Henderson

expr.c (store_constructor): Use rtvec_alloc instead of alloca+gen_rtvec_v...

        * expr.c (store_constructor): Use rtvec_alloc instead of
        alloca+gen_rtvec_v, and an incorrect number passed to alloca.

From-SVN: r93177
parent 35c0104b
2005-01-11 Richard Henderson <rth@redhat.com>
* expr.c (store_constructor): Use rtvec_alloc instead of
alloca+gen_rtvec_v, and an incorrect number passed to alloca.
2005-01-11 Kazu Hirata <kazu@cs.umass.edu> 2005-01-11 Kazu Hirata <kazu@cs.umass.edu>
* config/alpha/alpha.c, config/i386/mmx.md: Fix comment typos. * config/alpha/alpha.c, config/i386/mmx.md: Fix comment typos.
......
...@@ -4970,7 +4970,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) ...@@ -4970,7 +4970,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
enum machine_mode eltmode = TYPE_MODE (elttype); enum machine_mode eltmode = TYPE_MODE (elttype);
HOST_WIDE_INT bitsize; HOST_WIDE_INT bitsize;
HOST_WIDE_INT bitpos; HOST_WIDE_INT bitpos;
rtx *vector = NULL; rtvec vector = NULL;
unsigned n_elts; unsigned n_elts;
gcc_assert (eltmode != BLKmode); gcc_assert (eltmode != BLKmode);
...@@ -4985,9 +4985,9 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) ...@@ -4985,9 +4985,9 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
{ {
unsigned int i; unsigned int i;
vector = alloca (n_elts); vector = rtvec_alloc (n_elts);
for (i = 0; i < n_elts; i++) for (i = 0; i < n_elts; i++)
vector [i] = CONST0_RTX (GET_MODE_INNER (mode)); RTVEC_ELT (vector, i) = CONST0_RTX (GET_MODE_INNER (mode));
} }
} }
...@@ -5058,7 +5058,8 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) ...@@ -5058,7 +5058,8 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
/* Vector CONSTRUCTORs should only be built from smaller /* Vector CONSTRUCTORs should only be built from smaller
vectors in the case of BLKmode vectors. */ vectors in the case of BLKmode vectors. */
gcc_assert (TREE_CODE (TREE_TYPE (value)) != VECTOR_TYPE); gcc_assert (TREE_CODE (TREE_TYPE (value)) != VECTOR_TYPE);
vector[eltpos] = expand_expr (value, NULL_RTX, VOIDmode, 0); RTVEC_ELT (vector, eltpos)
= expand_expr (value, NULL_RTX, VOIDmode, 0);
} }
else else
{ {
...@@ -5076,8 +5077,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) ...@@ -5076,8 +5077,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
if (vector) if (vector)
emit_insn (GEN_FCN (icode) emit_insn (GEN_FCN (icode)
(target, (target,
gen_rtx_PARALLEL (GET_MODE (target), gen_rtx_PARALLEL (GET_MODE (target), vector)));
gen_rtvec_v (n_elts, vector))));
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment