]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
expr.c (store_constructor): Use rtvec_alloc instead of alloca+gen_rtvec_v...
authorRichard Henderson <rth@redhat.com>
Tue, 11 Jan 2005 08:37:00 +0000 (00:37 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 11 Jan 2005 08:37:00 +0000 (00:37 -0800)
        * expr.c (store_constructor): Use rtvec_alloc instead of
        alloca+gen_rtvec_v, and an incorrect number passed to alloca.

From-SVN: r93177

gcc/ChangeLog
gcc/expr.c

index dbc09956e7556f40e6dc73d7dfd0aaa9cf0f8ad9..a9d0155ea943d46094172ada185f6f5859d8708a 100644 (file)
@@ -1,3 +1,8 @@
+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>
 
        * config/alpha/alpha.c, config/i386/mmx.md: Fix comment typos.
index de34675ded923e646130a1dfcccaaba282660730..2e1320ec33628200d22352583c6f3fc83b6f7aa6 100644 (file)
@@ -4970,7 +4970,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
        enum machine_mode eltmode = TYPE_MODE (elttype);
        HOST_WIDE_INT bitsize;
        HOST_WIDE_INT bitpos;
-       rtx *vector = NULL;
+       rtvec vector = NULL;
        unsigned n_elts;
        
        gcc_assert (eltmode != BLKmode);
@@ -4985,9 +4985,9 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
              {
                unsigned int i;
                
-               vector = alloca (n_elts);
+               vector = rtvec_alloc (n_elts);
                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)
                /* Vector CONSTRUCTORs should only be built from smaller
                   vectors in the case of BLKmode vectors.  */
                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
              {
@@ -5076,8 +5077,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
        if (vector)
          emit_insn (GEN_FCN (icode)
                     (target,
-                     gen_rtx_PARALLEL (GET_MODE (target),
-                                       gen_rtvec_v (n_elts, vector))));
+                     gen_rtx_PARALLEL (GET_MODE (target), vector)));
        break;
       }