Commit 5b838011 by Richard Kenner

(alpha_builtin_saveregs): If -fcheck-memory-usage, set rights of saved

registers.

From-SVN: r14620
parent 7c6d4120
...@@ -1536,7 +1536,7 @@ struct rtx_def * ...@@ -1536,7 +1536,7 @@ struct rtx_def *
alpha_builtin_saveregs (arglist) alpha_builtin_saveregs (arglist)
tree arglist; tree arglist;
{ {
rtx block, addr, argsize; rtx block, addr, dest, argsize;
tree fntype = TREE_TYPE (current_function_decl); tree fntype = TREE_TYPE (current_function_decl);
int stdarg = (TYPE_ARG_TYPES (fntype) != 0 int stdarg = (TYPE_ARG_TYPES (fntype) != 0
&& (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype))) && (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype)))
...@@ -1591,14 +1591,28 @@ alpha_builtin_saveregs (arglist) ...@@ -1591,14 +1591,28 @@ alpha_builtin_saveregs (arglist)
/* Store the address of the first integer register in the __base /* Store the address of the first integer register in the __base
member. */ member. */
emit_move_insn (change_address (block, ptr_mode, XEXP (block, 0)), addr); dest = change_address (block, ptr_mode, XEXP (block, 0));
emit_move_insn (dest, addr);
if (flag_check_memory_usage)
emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3, dest,
ptr_mode, GEN_INT (GET_MODE_SIZE (ptr_mode)),
TYPE_MODE (sizetype),
GEN_INT (MEMORY_USE_RW), QImode);
/* Store the argsize as the __va_offset member. */ /* Store the argsize as the __va_offset member. */
emit_move_insn dest = change_address (block, TYPE_MODE (integer_type_node),
(change_address (block, TYPE_MODE (integer_type_node), plus_constant (XEXP (block, 0),
plus_constant (XEXP (block, 0), POINTER_SIZE/BITS_PER_UNIT));
POINTER_SIZE/BITS_PER_UNIT)), emit_move_insn (dest, argsize);
argsize);
if (flag_check_memory_usage)
emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3, dest,
ptr_mode,
GEN_INT (GET_MODE_SIZE
(TYPE_MODE (integer_type_node))),
TYPE_MODE (sizetype),
GEN_INT (MEMORY_USE_RW), QImode);
/* Return the address of the va_list constructor, but don't put it in a /* Return the address of the va_list constructor, but don't put it in a
register. Doing so would fail when not optimizing and produce worse register. Doing so would fail when not optimizing and produce worse
......
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