Commit fcf1b822 by Richard Kenner Committed by Richard Kenner

expr.c (clear_storage): Don't use emit_move_insn unless either BLKmode or proper size.

	* expr.c (clear_storage): Don't use emit_move_insn unless
	either BLKmode or proper size.
	(store_constructor): Don't call clear_storage if REG of wrong size.

From-SVN: r36101
parent ad17a40d
Fri Sep 1 10:59:47 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> Fri Sep 1 10:59:47 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* expr.c (clear_storage): Don't use emit_move_insn unless
either BLKmode or proper size.
(store_constructor): Don't call clear_storage if REG of wrong size.
* flow.c (init_propagate_block_info): Don't mark frame dead at end * flow.c (init_propagate_block_info): Don't mark frame dead at end
of function if returns wiht stack pointer depressed. of function if returns wiht stack pointer depressed.
......
...@@ -2392,7 +2392,13 @@ clear_storage (object, size, align) ...@@ -2392,7 +2392,13 @@ clear_storage (object, size, align)
#endif #endif
rtx retval = 0; rtx retval = 0;
if (GET_MODE (object) == BLKmode) /* If OBJECT is not BLKmode and SIZE is the same size as its mode,
just move a zero. Otherwise, do this a piece at a time. */
if (GET_MODE (object) != BLKmode
&& GET_CODE (size) == CONST_INT
&& GET_MODE_SIZE (GET_MODE (object)) == INTVAL (size))
emit_move_insn (object, CONST0_RTX (GET_MODE (object)));
else
{ {
object = protect_from_queue (object, 1); object = protect_from_queue (object, 1);
size = protect_from_queue (size, 0); size = protect_from_queue (size, 0);
...@@ -2544,8 +2550,6 @@ clear_storage (object, size, align) ...@@ -2544,8 +2550,6 @@ clear_storage (object, size, align)
#endif #endif
} }
} }
else
emit_move_insn (object, CONST0_RTX (GET_MODE (object)));
return retval; return retval;
} }
...@@ -4263,11 +4267,15 @@ store_constructor (exp, target, align, cleared, size) ...@@ -4263,11 +4267,15 @@ 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. Don't do this is TARGET is
register whose mode size isn't equal to SIZE since clear_storage
can't handle this case. */
else if (size > 0 else if (size > 0
&& ((list_length (CONSTRUCTOR_ELTS (exp)) && ((list_length (CONSTRUCTOR_ELTS (exp))
!= fields_length (type)) != fields_length (type))
|| mostly_zeros_p (exp))) || mostly_zeros_p (exp))
&& (GET_CODE (target) != REG
|| GET_MODE_SIZE (GET_MODE (target)) == size))
{ {
if (! cleared) if (! cleared)
clear_storage (target, GEN_INT (size), align); clear_storage (target, GEN_INT (size), align);
......
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