OSDN Git Service

(store_constructor): Properly compute size of array when
authorrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 5 Apr 1993 10:55:34 +0000 (10:55 +0000)
committerrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 5 Apr 1993 10:55:34 +0000 (10:55 +0000)
clearing the whole array.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@4021 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/expr.c

index 3d0bc0e..eadf2e3 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));