Commit 22619c3f by Richard Kenner

(store_expr): Don't clobber TEMP with address.

From-SVN: r8227
parent ce15adaa
...@@ -2743,6 +2743,7 @@ store_expr (exp, target, want_value) ...@@ -2743,6 +2743,7 @@ store_expr (exp, target, want_value)
The string constant may be shorter than the array. The string constant may be shorter than the array.
So copy just the string's actual length, and clear the rest. */ So copy just the string's actual length, and clear the rest. */
rtx size; rtx size;
rtx addr;
/* Get the size of the data type of the string, /* Get the size of the data type of the string,
which is actually the size of the target. */ which is actually the size of the target. */
...@@ -2771,17 +2772,16 @@ store_expr (exp, target, want_value) ...@@ -2771,17 +2772,16 @@ store_expr (exp, target, want_value)
that we have to clear. */ that we have to clear. */
if (GET_CODE (copy_size_rtx) == CONST_INT) if (GET_CODE (copy_size_rtx) == CONST_INT)
{ {
temp = plus_constant (XEXP (target, 0), addr = plus_constant (XEXP (target, 0),
TREE_STRING_LENGTH (exp)); TREE_STRING_LENGTH (exp));
size = plus_constant (size, size = plus_constant (size, - TREE_STRING_LENGTH (exp));
- TREE_STRING_LENGTH (exp));
} }
else else
{ {
enum machine_mode size_mode = Pmode; enum machine_mode size_mode = Pmode;
temp = force_reg (Pmode, XEXP (target, 0)); addr = force_reg (Pmode, XEXP (target, 0));
temp = expand_binop (size_mode, add_optab, temp, addr = expand_binop (size_mode, add_optab, addr,
copy_size_rtx, NULL_RTX, 0, copy_size_rtx, NULL_RTX, 0,
OPTAB_LIB_WIDEN); OPTAB_LIB_WIDEN);
...@@ -2798,13 +2798,14 @@ store_expr (exp, target, want_value) ...@@ -2798,13 +2798,14 @@ store_expr (exp, target, want_value)
if (size != const0_rtx) if (size != const0_rtx)
{ {
#ifdef TARGET_MEM_FUNCTIONS #ifdef TARGET_MEM_FUNCTIONS
emit_library_call (memset_libfunc, 0, VOIDmode, 3, emit_library_call (memset_libfunc, 0, VOIDmode, 3, addr,
temp, Pmode, const0_rtx, Pmode, size, Pmode); Pmode, const0_rtx, Pmode, size, Pmode);
#else #else
emit_library_call (bzero_libfunc, 0, VOIDmode, 2, emit_library_call (bzero_libfunc, 0, VOIDmode, 2,
temp, Pmode, size, Pmode); addr, Pmode, size, Pmode);
#endif #endif
} }
if (label) if (label)
emit_label (label); emit_label (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