Commit 9376fcd6 by Richard Kenner Committed by Richard Kenner

expr.c (store_constructor): Don't call clear_storage if size is variable.

	* expr.c (store_constructor): Don't call clear_storage if size is
	variable.

From-SVN: r31086
parent 272df862
Fri Dec 24 12:34:26 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* expr.c (store_constructor): Don't call clear_storage if size is
variable.
1999-12-24 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 1999-12-24 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Makefile.in (toplev.o): Depend on loop.h. * Makefile.in (toplev.o): Depend on loop.h.
......
...@@ -4151,9 +4151,10 @@ store_constructor (exp, target, align, cleared, size) ...@@ -4151,9 +4151,10 @@ store_constructor (exp, target, align, cleared, size)
/* If the constructor has fewer fields than the structure /* If the constructor has fewer fields than the structure
or if we are initializing the structure to mostly zeros, or if we are initializing the structure to mostly zeros,
clear the whole structure first. */ clear the whole structure first. */
else if ((list_length (CONSTRUCTOR_ELTS (exp)) else if (size > 0
&& ((list_length (CONSTRUCTOR_ELTS (exp))
!= list_length (TYPE_FIELDS (type))) != list_length (TYPE_FIELDS (type)))
|| mostly_zeros_p (exp)) || mostly_zeros_p (exp)))
{ {
if (! cleared) if (! cleared)
clear_storage (target, GEN_INT (size), clear_storage (target, GEN_INT (size),
...@@ -4339,7 +4340,7 @@ store_constructor (exp, target, align, cleared, size) ...@@ -4339,7 +4340,7 @@ store_constructor (exp, target, align, cleared, size)
|| 4 * zero_count >= 3 * count) || 4 * zero_count >= 3 * count)
need_to_clear = 1; need_to_clear = 1;
} }
if (need_to_clear) if (need_to_clear && size > 0)
{ {
if (! cleared) if (! cleared)
clear_storage (target, GEN_INT (size), clear_storage (target, GEN_INT (size),
...@@ -4519,7 +4520,7 @@ store_constructor (exp, target, align, cleared, size) ...@@ -4519,7 +4520,7 @@ store_constructor (exp, target, align, cleared, size)
bzero/memset), and set the bits we want. */ bzero/memset), and set the bits we want. */
/* Check for all zeros. */ /* Check for all zeros. */
if (elt == NULL_TREE) if (elt == NULL_TREE && size > 0)
{ {
if (!cleared) if (!cleared)
clear_storage (target, GEN_INT (size), clear_storage (target, GEN_INT (size),
......
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