Commit 7ce3fc8f by Ulrich Weigand Committed by Ulrich Weigand

builtins.c (expand_builtin_strlen): Do not call emit_move_insn with a PLUS as source operand.

	* builtins.c (expand_builtin_strlen): Do not call emit_move_insn
	with a PLUS as source operand.
	(expand_movstr): Likewise.
	(expand_builtin_stpcpy): Likewise.

From-SVN: r88322
parent e670d9e4
2004-09-29 Ulrich Weigand <uweigand@de.ibm.com>
* builtins.c (expand_builtin_strlen): Do not call emit_move_insn
with a PLUS as source operand.
(expand_movstr): Likewise.
(expand_builtin_stpcpy): Likewise.
2004-09-29 Richard Henderson <rth@redhat.com> 2004-09-29 Richard Henderson <rth@redhat.com>
PR 17739 PR 17739
......
...@@ -2433,8 +2433,7 @@ expand_builtin_strlen (tree arglist, rtx target, ...@@ -2433,8 +2433,7 @@ expand_builtin_strlen (tree arglist, rtx target,
/* Now that we are assured of success, expand the source. */ /* Now that we are assured of success, expand the source. */
start_sequence (); start_sequence ();
pat = memory_address (BLKmode, pat = expand_expr (src, src_reg, ptr_mode, EXPAND_NORMAL);
expand_expr (src, src_reg, ptr_mode, EXPAND_SUM));
if (pat != src_reg) if (pat != src_reg)
emit_move_insn (src_reg, pat); emit_move_insn (src_reg, pat);
pat = get_insns (); pat = get_insns ();
...@@ -3045,8 +3044,10 @@ expand_movstr (tree dest, tree src, rtx target, int endp) ...@@ -3045,8 +3044,10 @@ expand_movstr (tree dest, tree src, rtx target, int endp)
terminator. If the caller requested a mempcpy-like return value, terminator. If the caller requested a mempcpy-like return value,
adjust it. */ adjust it. */
if (endp == 1 && target != const0_rtx) if (endp == 1 && target != const0_rtx)
emit_move_insn (target, plus_constant (gen_lowpart (GET_MODE (target), {
end), 1)); rtx tem = plus_constant (gen_lowpart (GET_MODE (target), end), 1);
emit_move_insn (target, force_operand (tem, NULL_RTX));
}
return target; return target;
} }
...@@ -3156,9 +3157,8 @@ expand_builtin_stpcpy (tree arglist, rtx target, enum machine_mode mode) ...@@ -3156,9 +3157,8 @@ expand_builtin_stpcpy (tree arglist, rtx target, enum machine_mode mode)
if (GET_MODE (target) != GET_MODE (ret)) if (GET_MODE (target) != GET_MODE (ret))
ret = gen_lowpart (GET_MODE (target), ret); ret = gen_lowpart (GET_MODE (target), ret);
ret = emit_move_insn (target, ret = plus_constant (ret, INTVAL (len_rtx));
plus_constant (ret, ret = emit_move_insn (target, force_operand (ret, NULL_RTX));
INTVAL (len_rtx)));
gcc_assert (ret); gcc_assert (ret);
return target; return target;
......
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