Commit 2a5b96fd by Jan Hubicka Committed by Jan Hubicka

expr.c (store_expr): Use clear_storage instead of direct memset libcall.

	* expr.c (store_expr): Use clear_storage instead of direct memset
	libcall.

From-SVN: r33484
parent 6d844225
Thu Apr 27 16:11:00 MET DST 2000 Jan Hubicka <jh@suse.cz>
* expr.c (store_expr): Use clear_storage instead of direct memset
libcall.
Thu Apr 27 10:36:51 2000 Alexandre Oliva <aoliva@cygnus.com> Thu Apr 27 10:36:51 2000 Alexandre Oliva <aoliva@cygnus.com>
* config/mn10300/mn10300.c (mn10300_address_cost): Test * config/mn10300/mn10300.c (mn10300_address_cost): Test
......
...@@ -3933,6 +3933,7 @@ store_expr (exp, target, want_value) ...@@ -3933,6 +3933,7 @@ store_expr (exp, target, want_value)
= size_binop (MIN_EXPR, = size_binop (MIN_EXPR,
make_tree (sizetype, size), make_tree (sizetype, size),
size_int (TREE_STRING_LENGTH (exp))); size_int (TREE_STRING_LENGTH (exp)));
int align = TYPE_ALIGN (TREE_TYPE (exp));
rtx copy_size_rtx = expand_expr (copy_size, NULL_RTX, rtx copy_size_rtx = expand_expr (copy_size, NULL_RTX,
VOIDmode, 0); VOIDmode, 0);
rtx label = 0; rtx label = 0;
...@@ -3951,6 +3952,9 @@ store_expr (exp, target, want_value) ...@@ -3951,6 +3952,9 @@ store_expr (exp, target, want_value)
{ {
addr = plus_constant (addr, TREE_STRING_LENGTH (exp)); addr = plus_constant (addr, TREE_STRING_LENGTH (exp));
size = plus_constant (size, - TREE_STRING_LENGTH (exp)); size = plus_constant (size, - TREE_STRING_LENGTH (exp));
align = MIN (align, (BITS_PER_UNIT
* (INTVAL (copy_size_rtx)
& - INTVAL (copy_size_rtx))));
} }
else else
{ {
...@@ -3963,10 +3967,12 @@ store_expr (exp, target, want_value) ...@@ -3963,10 +3967,12 @@ store_expr (exp, target, want_value)
copy_size_rtx, NULL_RTX, 0, copy_size_rtx, NULL_RTX, 0,
OPTAB_LIB_WIDEN); OPTAB_LIB_WIDEN);
align = BITS_PER_UNIT;
label = gen_label_rtx (); label = gen_label_rtx ();
emit_cmp_and_jump_insns (size, const0_rtx, LT, NULL_RTX, emit_cmp_and_jump_insns (size, const0_rtx, LT, NULL_RTX,
GET_MODE (size), 0, 0, label); GET_MODE (size), 0, 0, label);
} }
align = MIN (align, expr_align (copy_size));
if (size != const0_rtx) if (size != const0_rtx)
{ {
...@@ -3977,22 +3983,7 @@ store_expr (exp, target, want_value) ...@@ -3977,22 +3983,7 @@ store_expr (exp, target, want_value)
size, TYPE_MODE (sizetype), size, TYPE_MODE (sizetype),
GEN_INT (MEMORY_USE_WO), GEN_INT (MEMORY_USE_WO),
TYPE_MODE (integer_type_node)); TYPE_MODE (integer_type_node));
#ifdef TARGET_MEM_FUNCTIONS clear_storage (gen_rtx_MEM (BLKmode, addr), size, align);
emit_library_call (memset_libfunc, 0, VOIDmode, 3,
addr, ptr_mode,
const0_rtx, TYPE_MODE (integer_type_node),
convert_to_mode (TYPE_MODE (sizetype),
size,
TREE_UNSIGNED (sizetype)),
TYPE_MODE (sizetype));
#else
emit_library_call (bzero_libfunc, 0, VOIDmode, 2,
addr, ptr_mode,
convert_to_mode (TYPE_MODE (integer_type_node),
size,
TREE_UNSIGNED (integer_type_node)),
TYPE_MODE (integer_type_node));
#endif
} }
if (label) if (label)
......
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