(store_constructor): Properly compute size of array when
authorRichard Stallman <rms@gnu.org>
Mon, 5 Apr 1993 10:55:34 +0000 (10:55 +0000)
committerRichard Stallman <rms@gnu.org>
Mon, 5 Apr 1993 10:55:34 +0000 (10:55 +0000)
clearing the whole array.

From-SVN: r4021

gcc/expr.c

index 3d0bc0e716801e1f580a7599b59b4e948a338d22..eadf2e3b9f523105eeaa771a4eeb1add532f1b63 100644 (file)
@@ -2565,7 +2565,7 @@ store_constructor (exp, target)
 
       if (list_length (CONSTRUCTOR_ELTS (exp)) < maxelt - minelt + 1
          || (GET_CODE (target) == REG && TREE_STATIC (exp)))
-       clear_storage (target, maxelt - minelt + 1);
+       clear_storage (target, int_size_in_bytes (type));
       else
        /* Inform later passes that the old value is dead.  */
        emit_insn (gen_rtx (CLOBBER, VOIDmode, target));