From: Per Bothner Date: Tue, 23 Apr 1996 20:01:58 +0000 (-0700) Subject: * expr.c (store_constructor): Fix test for missing array elements. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8e958f701f160e5eb907f84842ade7696ec4a7de;p=gcc.git * expr.c (store_constructor): Fix test for missing array elements. From-SVN: r11869 --- diff --git a/gcc/expr.c b/gcc/expr.c index f539b49ab08..278cfb36af4 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -3488,7 +3488,10 @@ store_constructor (exp, target, cleared) if (mostly_zeros_p (TREE_VALUE (elt))) zero_count += this_node_count; } - if (4 * zero_count >= 3 * count) + /* Clear the entire array first if there are any missing elements, + or if the incidence of zero elements is >= 75%. */ + if (count < maxelt - minelt + 1 + || 4 * zero_count >= 3 * count) need_to_clear = 1; } if (need_to_clear)