From: Richard Kenner Date: Sun, 28 Oct 2001 20:42:29 +0000 (+0000) Subject: builtins.c (get_memory_rtx): Handle POINTERS_EXTEND_UNSIGNED case. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ce2d32cd37c98b11b3f022695f9cfba0faf9151b;p=gcc.git builtins.c (get_memory_rtx): Handle POINTERS_EXTEND_UNSIGNED case. * 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. From-SVN: r46598 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b3b83b23ef8..e6d48285caf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +Sun Oct 28 15:45:16 2001 Richard Kenner + + * 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. + 2001-10-28 Joseph S. Myers * ChangeLog.0, ChangeLog.1, ChangeLog.2, ChangeLog.3, ChangeLog.4, 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))));