Commit fa465762 by H.J. Lu Committed by H.J. Lu

Properly expand strlen to Pmode.

2011-06-14  H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/47364
	* builtins.c (expand_builtin_strlen): Expand strlen to Pmode
	and properly handle result not in Pmode.

From-SVN: r175034
parent 652de9ff
2011-06-14 H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/47364
* builtins.c (expand_builtin_strlen): Expand strlen to Pmode
and properly handle result not in Pmode.
2011-06-14 Robert Millan <rmh@gnu.org> 2011-06-14 Robert Millan <rmh@gnu.org>
* config/i386/kfreebsd-gnu.h: Resync with `config/i386/linux.h'. * config/i386/kfreebsd-gnu.h: Resync with `config/i386/linux.h'.
......
...@@ -2939,9 +2939,16 @@ expand_builtin_strlen (tree exp, rtx target, ...@@ -2939,9 +2939,16 @@ expand_builtin_strlen (tree exp, 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 = expand_expr (src, src_reg, ptr_mode, EXPAND_NORMAL); pat = expand_expr (src, src_reg, Pmode, EXPAND_NORMAL);
if (pat != src_reg) if (pat != src_reg)
emit_move_insn (src_reg, pat); {
#ifdef POINTERS_EXTEND_UNSIGNED
if (GET_MODE (pat) != Pmode)
pat = convert_to_mode (Pmode, pat,
POINTERS_EXTEND_UNSIGNED);
#endif
emit_move_insn (src_reg, pat);
}
pat = get_insns (); pat = get_insns ();
end_sequence (); end_sequence ();
......
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