summaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-28 20:42:29 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-28 20:42:29 +0000
commit726ec87c491621121b4fbb3531d64571324dd189 (patch)
treeecb90e14f51eb8bdd8ee1e70a0d371c225c9e681 /gcc/builtins.c
parent424da949b9e792266e5ab268fef9d84d83845039 (diff)
downloadgcc-726ec87c491621121b4fbb3531d64571324dd189.tar.gz
* builtins.c (get_memory_rtx): Handle POINTERS_EXTEND_UNSIGNED case.
(expand_builtin_apply, expand_builtin_return): Likewise. (expand_builtin_va_arg, expand_builtin_va_copy): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46598 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c38
1 files changed, 32 insertions, 6 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 2ff203e578f..28be3422f58 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -722,11 +722,15 @@ static rtx
get_memory_rtx (exp)
tree exp;
{
- rtx mem = gen_rtx_MEM (BLKmode,
- memory_address (BLKmode,
- expand_expr (exp, NULL_RTX,
- ptr_mode, EXPAND_SUM)));
+ rtx addr = expand_expr (exp, NULL_RTX, ptr_mode, EXPAND_SUM);
+ rtx mem;
+#ifdef POINTERS_EXTEND_UNSIGNED
+ if (GET_MODE (addr) != Pmode)
+ addr = convert_memory_address (Pmode, addr);
+#endif
+
+ mem = gen_rtx_MEM (BLKmode, memory_address (BLKmode, addr));
set_mem_attributes (mem, exp, 0);
/* Get an expression we can use to find the attributes to assign to MEM.
@@ -1048,13 +1052,17 @@ expand_builtin_apply (function, arguments, argsize)
rtx old_stack_level = 0;
rtx call_fusage = 0;
+#ifdef POINTERS_EXTEND_UNSIGNED
+ if (GET_MODE (arguments) != Pmode)
+ arguments = convert_memory_address (Pmode, arguments);
+#endif
+
/* Create a block where the return registers can be saved. */
result = assign_stack_local (BLKmode, apply_result_size (), -1);
/* Fetch the arg pointer from the ARGUMENTS block. */
incoming_args = gen_reg_rtx (Pmode);
- emit_move_insn (incoming_args,
- gen_rtx_MEM (Pmode, arguments));
+ emit_move_insn (incoming_args, gen_rtx_MEM (Pmode, arguments));
#ifndef STACK_GROWS_DOWNWARD
incoming_args = expand_simple_binop (Pmode, MINUS, incoming_args, argsize,
incoming_args, 0, OPTAB_LIB_WIDEN);
@@ -1218,6 +1226,11 @@ expand_builtin_return (result)
rtx reg;
rtx call_fusage = 0;
+#ifdef POINTERS_EXTEND_UNSIGNED
+ if (GET_MODE (result) != Pmode)
+ result = convert_memory_address (Pmode, result);
+#endif
+
apply_result_size ();
result = gen_rtx_MEM (BLKmode, result);
@@ -2959,6 +2972,11 @@ expand_builtin_va_arg (valist, type)
#endif
}
+#ifdef POINTERS_EXTEND_UNSIGNED
+ if (GET_MODE (addr) != Pmode)
+ addr = convert_memory_address (Pmode, addr);
+#endif
+
result = gen_rtx_MEM (TYPE_MODE (type), addr);
set_mem_alias_set (result, get_varargs_alias_set ());
@@ -3018,6 +3036,14 @@ expand_builtin_va_copy (arglist)
size = expand_expr (TYPE_SIZE_UNIT (va_list_type_node), NULL_RTX,
VOIDmode, EXPAND_NORMAL);
+#ifdef POINTERS_EXTEND_UNSIGNED
+ if (GET_MODE (dstb) != Pmode)
+ dstb = convert_memory_address (Pmode, dstb);
+
+ if (GET_MODE (srcb) != Pmode)
+ srcb = convert_memory_address (Pmode, srcb);
+#endif
+
/* "Dereference" to BLKmode memories. */
dstb = gen_rtx_MEM (BLKmode, dstb);
set_mem_alias_set (dstb, get_alias_set (TREE_TYPE (TREE_TYPE (dst))));