diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-09-18 20:43:13 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-09-18 20:43:13 +0000 |
commit | 85d654ddd4b94ecbd2d2f291a6b6404fcde249ec (patch) | |
tree | dc06eda173c4ba3b692dac9d2c7c0e70f0eeba75 /gcc | |
parent | 282368caa60b41902b386d6890cc601ee18a9e29 (diff) | |
download | gcc-85d654ddd4b94ecbd2d2f291a6b6404fcde249ec.tar.gz |
PR target/11184
* builtins.c (expand_builtin_apply): Use convert_memory_address
before returning the value.
* alias.c (find_base_value): Simplify use of
convert_memory_address.
(find_base_term): Likewise.
* builtins.c (expand_builtin_stejmp_setup): Likewise.
(expand_builtin_longjmp): Likewise.
(expand_builtin_prefetch): Likewise.
(get_memory_rtx): Likewise.
(expand_builtin_return): Likewise.
(expand_builtin_memcpy): Likewise.
(expand_builtin_strncpy): Likewise.
(expand_builtin_memset): Likewise.
(expand_builtin_va_arg): Likewise.
(expand_builtin_va_copy): Likewise.
(expand_builtin_alloca): Likewise.
* calls.c (expand_call): Likewise.
* except.c (expand_builtin_extract_return_addr): Likewise.
(expand_builtin_eh_return): Likewise.
* explow.c (convert_memory_address): Define even when
POINTER_EXTEND_UNSIGNED is not defined. Do nothing if the address
is already in the right mode.
* explow.c (memory_address): Simplify use of convert_memory_address.
(probe_stack_range): Likewise.
* expmed.c (make_tree): Likewise.
* expr.c (emit_block_move_in_libcall): Likewise.
(expand_assignment): Likewise.
(expand_expr): Likewise.
* function.c (assign_parms): Likewise.
(expand_function_end): Likewise.
* integrate.c (copy_rtx_and_substitute): Likewise.
* stmt.c (expand_computed_goto): Likewise.
PR target/11184
* gcc.dg/builtin-apply1.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71539 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 37 | ||||
-rw-r--r-- | gcc/alias.c | 8 | ||||
-rw-r--r-- | gcc/builtins.c | 93 | ||||
-rw-r--r-- | gcc/calls.c | 7 | ||||
-rw-r--r-- | gcc/except.c | 15 | ||||
-rw-r--r-- | gcc/explow.c | 29 | ||||
-rw-r--r-- | gcc/expmed.c | 4 | ||||
-rw-r--r-- | gcc/expr.c | 17 | ||||
-rw-r--r-- | gcc/function.c | 13 | ||||
-rw-r--r-- | gcc/integrate.c | 6 | ||||
-rw-r--r-- | gcc/stmt.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/builtin-apply1.c | 9 |
13 files changed, 102 insertions, 146 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index aac42bff409..2634cbbcedd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,40 @@ +2003-09-18 Mark Mitchell <mark@codesourcery.com> + + PR target/11184 + * builtins.c (expand_builtin_apply): Use convert_memory_address + before returning the value. + + * alias.c (find_base_value): Simplify use of + convert_memory_address. + (find_base_term): Likewise. + * builtins.c (expand_builtin_stejmp_setup): Likewise. + (expand_builtin_longjmp): Likewise. + (expand_builtin_prefetch): Likewise. + (get_memory_rtx): Likewise. + (expand_builtin_return): Likewise. + (expand_builtin_memcpy): Likewise. + (expand_builtin_strncpy): Likewise. + (expand_builtin_memset): Likewise. + (expand_builtin_va_arg): Likewise. + (expand_builtin_va_copy): Likewise. + (expand_builtin_alloca): Likewise. + * calls.c (expand_call): Likewise. + * except.c (expand_builtin_extract_return_addr): Likewise. + (expand_builtin_eh_return): Likewise. + * explow.c (convert_memory_address): Define even when + POINTER_EXTEND_UNSIGNED is not defined. Do nothing if the address + is already in the right mode. + * explow.c (memory_address): Simplify use of convert_memory_address. + (probe_stack_range): Likewise. + * expmed.c (make_tree): Likewise. + * expr.c (emit_block_move_in_libcall): Likewise. + (expand_assignment): Likewise. + (expand_expr): Likewise. + * function.c (assign_parms): Likewise. + (expand_function_end): Likewise. + * integrate.c (copy_rtx_and_substitute): Likewise. + * stmt.c (expand_computed_goto): Likewise. + 2003-09-18 Roger Sayle <roger@eyesopen.com> * simplify-rtx.c (simplify_unary_operation): Only transform diff --git a/gcc/alias.c b/gcc/alias.c index c3bdf766cb2..19ac3f78655 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -888,10 +888,8 @@ find_base_value (rtx src) { rtx temp = find_base_value (XEXP (src, 0)); -#ifdef POINTERS_EXTEND_UNSIGNED - if (temp != 0 && CONSTANT_P (temp) && GET_MODE (temp) != Pmode) + if (temp != 0 && CONSTANT_P (temp)) temp = convert_memory_address (Pmode, temp); -#endif return temp; } @@ -1307,10 +1305,8 @@ find_base_term (rtx x) { rtx temp = find_base_term (XEXP (x, 0)); -#ifdef POINTERS_EXTEND_UNSIGNED - if (temp != 0 && CONSTANT_P (temp) && GET_MODE (temp) != Pmode) + if (temp != 0 && CONSTANT_P (temp)) temp = convert_memory_address (Pmode, temp); -#endif return temp; } diff --git a/gcc/builtins.c b/gcc/builtins.c index 2e8189d106c..5de1ac35a5a 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -477,10 +477,7 @@ expand_builtin_setjmp_setup (rtx buf_addr, rtx receiver_label) if (setjmp_alias_set == -1) setjmp_alias_set = new_alias_set (); -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE (buf_addr) != Pmode) - buf_addr = convert_memory_address (Pmode, buf_addr); -#endif + buf_addr = convert_memory_address (Pmode, buf_addr); buf_addr = force_reg (Pmode, force_operand (buf_addr, NULL_RTX)); @@ -661,10 +658,7 @@ expand_builtin_longjmp (rtx buf_addr, rtx value) if (setjmp_alias_set == -1) setjmp_alias_set = new_alias_set (); -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE (buf_addr) != Pmode) - buf_addr = convert_memory_address (Pmode, buf_addr); -#endif + buf_addr = convert_memory_address (Pmode, buf_addr); buf_addr = force_reg (Pmode, buf_addr); @@ -807,10 +801,7 @@ expand_builtin_prefetch (tree arglist) insn_data[(int) CODE_FOR_prefetch].operand[0].mode)) || (GET_MODE (op0) != Pmode)) { -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE (op0) != Pmode) - op0 = convert_memory_address (Pmode, op0); -#endif + op0 = convert_memory_address (Pmode, op0); op0 = force_reg (Pmode, op0); } emit_insn (gen_prefetch (op0, op1, op2)); @@ -833,10 +824,7 @@ get_memory_rtx (tree exp) 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 + addr = convert_memory_address (Pmode, addr); mem = gen_rtx_MEM (BLKmode, memory_address (BLKmode, addr)); @@ -1193,10 +1181,7 @@ expand_builtin_apply (rtx function, rtx arguments, rtx argsize) rtx call_fusage = 0; rtx struct_value = targetm.calls.struct_value_rtx (cfun ? TREE_TYPE (cfun->decl) : 0, 0); -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE (arguments) != Pmode) - arguments = convert_memory_address (Pmode, arguments); -#endif + arguments = convert_memory_address (Pmode, arguments); /* Create a block where the return registers can be saved. */ result = assign_stack_local (BLKmode, apply_result_size (), -1); @@ -1334,7 +1319,8 @@ expand_builtin_apply (rtx function, rtx arguments, rtx argsize) OK_DEFER_POP; /* Return the address of the result block. */ - return copy_addr_to_reg (XEXP (result, 0)); + result = copy_addr_to_reg (XEXP (result, 0)); + return convert_memory_address (ptr_mode, result); } /* Perform an untyped return. */ @@ -1347,10 +1333,7 @@ expand_builtin_return (rtx result) rtx reg; rtx call_fusage = 0; -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE (result) != Pmode) - result = convert_memory_address (Pmode, result); -#endif + result = convert_memory_address (Pmode, result); apply_result_size (); result = gen_rtx_MEM (BLKmode, result); @@ -2521,10 +2504,7 @@ expand_builtin_memcpy (tree arglist, rtx target, enum machine_mode mode) builtin_memcpy_read_str, (void *) src_str, dest_align, 0); dest_mem = force_operand (XEXP (dest_mem, 0), NULL_RTX); -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE (dest_mem) != ptr_mode) - dest_mem = convert_memory_address (ptr_mode, dest_mem); -#endif + dest_mem = convert_memory_address (ptr_mode, dest_mem); return dest_mem; } @@ -2538,10 +2518,7 @@ expand_builtin_memcpy (tree arglist, rtx target, enum machine_mode mode) if (dest_addr == 0) { dest_addr = force_operand (XEXP (dest_mem, 0), NULL_RTX); -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE (dest_addr) != ptr_mode) - dest_addr = convert_memory_address (ptr_mode, dest_addr); -#endif + dest_addr = convert_memory_address (ptr_mode, dest_addr); } return dest_addr; } @@ -2620,10 +2597,7 @@ expand_builtin_mempcpy (tree arglist, rtx target, enum machine_mode mode, builtin_memcpy_read_str, (void *) src_str, dest_align, endp); dest_mem = force_operand (XEXP (dest_mem, 0), NULL_RTX); -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE (dest_mem) != ptr_mode) - dest_mem = convert_memory_address (ptr_mode, dest_mem); -#endif + dest_mem = convert_memory_address (ptr_mode, dest_mem); return dest_mem; } @@ -2638,10 +2612,7 @@ expand_builtin_mempcpy (tree arglist, rtx target, enum machine_mode mode, dest_mem = move_by_pieces (dest_mem, src_mem, INTVAL (len_rtx), MIN (dest_align, src_align), endp); dest_mem = force_operand (XEXP (dest_mem, 0), NULL_RTX); -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE (dest_mem) != ptr_mode) - dest_mem = convert_memory_address (ptr_mode, dest_mem); -#endif + dest_mem = convert_memory_address (ptr_mode, dest_mem); return dest_mem; } @@ -2877,10 +2848,7 @@ expand_builtin_strncpy (tree arglist, rtx target, enum machine_mode mode) builtin_strncpy_read_str, (void *) p, dest_align, 0); dest_mem = force_operand (XEXP (dest_mem, 0), NULL_RTX); -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE (dest_mem) != ptr_mode) - dest_mem = convert_memory_address (ptr_mode, dest_mem); -#endif + dest_mem = convert_memory_address (ptr_mode, dest_mem); return dest_mem; } @@ -2998,10 +2966,7 @@ expand_builtin_memset (tree arglist, rtx target, enum machine_mode mode) builtin_memset_gen_str, val_rtx, dest_align, 0); dest_mem = force_operand (XEXP (dest_mem, 0), NULL_RTX); -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE (dest_mem) != ptr_mode) - dest_mem = convert_memory_address (ptr_mode, dest_mem); -#endif + dest_mem = convert_memory_address (ptr_mode, dest_mem); return dest_mem; } @@ -3022,10 +2987,7 @@ expand_builtin_memset (tree arglist, rtx target, enum machine_mode mode) builtin_memset_read_str, &c, dest_align, 0); dest_mem = force_operand (XEXP (dest_mem, 0), NULL_RTX); -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE (dest_mem) != ptr_mode) - dest_mem = convert_memory_address (ptr_mode, dest_mem); -#endif + dest_mem = convert_memory_address (ptr_mode, dest_mem); return dest_mem; } @@ -3038,10 +3000,7 @@ expand_builtin_memset (tree arglist, rtx target, enum machine_mode mode) if (dest_addr == 0) { dest_addr = force_operand (XEXP (dest_mem, 0), NULL_RTX); -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE (dest_addr) != ptr_mode) - dest_addr = convert_memory_address (ptr_mode, dest_addr); -#endif + dest_addr = convert_memory_address (ptr_mode, dest_addr); } return dest_addr; @@ -4039,10 +3998,7 @@ expand_builtin_va_arg (tree valist, tree type) #endif } -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE (addr) != Pmode) - addr = convert_memory_address (Pmode, addr); -#endif + addr = convert_memory_address (Pmode, addr); result = gen_rtx_MEM (TYPE_MODE (type), addr); set_mem_alias_set (result, get_varargs_alias_set ()); @@ -4101,13 +4057,8 @@ expand_builtin_va_copy (tree 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 + dstb = convert_memory_address (Pmode, dstb); + srcb = convert_memory_address (Pmode, srcb); /* "Dereference" to BLKmode memories. */ dstb = gen_rtx_MEM (BLKmode, dstb); @@ -4190,11 +4141,7 @@ expand_builtin_alloca (tree arglist, rtx target) /* Allocate the desired space. */ result = allocate_dynamic_stack_space (op0, target, BITS_PER_UNIT); - -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE (result) != ptr_mode) - result = convert_memory_address (ptr_mode, result); -#endif + result = convert_memory_address (ptr_mode, result); return result; } diff --git a/gcc/calls.c b/gcc/calls.c index f8e7ea06d00..2c952ab1b68 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -3026,11 +3026,8 @@ expand_call (tree exp, rtx target, int ignore) structure value. */ if (pass != 0 && structure_value_addr && ! structure_value_addr_parm) { -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE (structure_value_addr) != Pmode) - structure_value_addr = convert_memory_address - (Pmode, structure_value_addr); -#endif + structure_value_addr + = convert_memory_address (Pmode, structure_value_addr); emit_move_insn (struct_value, force_reg (Pmode, force_operand (structure_value_addr, diff --git a/gcc/except.c b/gcc/except.c index f275866aa6f..6745dd1bd5e 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -2974,10 +2974,7 @@ expand_builtin_frob_return_addr (tree addr_tree) { rtx addr = expand_expr (addr_tree, NULL_RTX, ptr_mode, 0); -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE (addr) != Pmode) - addr = convert_memory_address (Pmode, addr); -#endif + addr = convert_memory_address (Pmode, addr); #ifdef RETURN_ADDR_OFFSET addr = force_reg (Pmode, addr); @@ -2998,10 +2995,7 @@ expand_builtin_eh_return (tree stackadj_tree ATTRIBUTE_UNUSED, #ifdef EH_RETURN_STACKADJ_RTX tmp = expand_expr (stackadj_tree, cfun->eh->ehr_stackadj, VOIDmode, 0); -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE (tmp) != Pmode) - tmp = convert_memory_address (Pmode, tmp); -#endif + tmp = convert_memory_address (Pmode, tmp); if (!cfun->eh->ehr_stackadj) cfun->eh->ehr_stackadj = copy_to_reg (tmp); else if (tmp != cfun->eh->ehr_stackadj) @@ -3009,10 +3003,7 @@ expand_builtin_eh_return (tree stackadj_tree ATTRIBUTE_UNUSED, #endif tmp = expand_expr (handler_tree, cfun->eh->ehr_handler, VOIDmode, 0); -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE (tmp) != Pmode) - tmp = convert_memory_address (Pmode, tmp); -#endif + tmp = convert_memory_address (Pmode, tmp); if (!cfun->eh->ehr_handler) cfun->eh->ehr_handler = copy_to_reg (tmp); else if (tmp != cfun->eh->ehr_handler) diff --git a/gcc/explow.c b/gcc/explow.c index e9ca57b7803..56f9a3ff04a 100644 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -303,8 +303,6 @@ break_out_memory_refs (rtx x) return x; } -#ifdef POINTERS_EXTEND_UNSIGNED - /* Given X, a memory address in ptr_mode, convert it to an address in Pmode, or vice versa (TO_MODE says which way). We take advantage of the fact that pointers are not allowed to overflow by commuting arithmetic @@ -312,12 +310,22 @@ break_out_memory_refs (rtx x) used. */ rtx -convert_memory_address (enum machine_mode to_mode, rtx x) +convert_memory_address (enum machine_mode to_mode ATTRIBUTE_UNUSED, + rtx x) { - enum machine_mode from_mode = to_mode == ptr_mode ? Pmode : ptr_mode; +#ifndef POINTERS_EXTEND_UNSIGNED + return x; +#else /* defined(POINTERS_EXTEND_UNSIGNED) */ + enum machine_mode from_mode; rtx temp; enum rtx_code code; + /* If X already has the right mode, just return it. */ + if (GET_MODE (x) == to_mode) + return x; + + from_mode = to_mode == ptr_mode ? Pmode : ptr_mode; + /* Here we handle some special cases. If none of them apply, fall through to the default case. */ switch (GET_CODE (x)) @@ -381,8 +389,8 @@ convert_memory_address (enum machine_mode to_mode, rtx x) return convert_modes (to_mode, from_mode, x, POINTERS_EXTEND_UNSIGNED); +#endif /* defined(POINTERS_EXTEND_UNSIGNED) */ } -#endif /* Given a memory address or facsimile X, construct a new address, currently equivalent, that is stable: future stores won't change it. @@ -434,10 +442,7 @@ memory_address (enum machine_mode mode, rtx x) if (GET_CODE (x) == ADDRESSOF) return x; -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE (x) != Pmode) - x = convert_memory_address (Pmode, x); -#endif + x = convert_memory_address (Pmode, x); /* By passing constant addresses thru registers we get a chance to cse them. */ @@ -1419,11 +1424,7 @@ probe_stack_range (HOST_WIDE_INT first, rtx size) stack_pointer_rtx, plus_constant (size, first))); -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE (addr) != ptr_mode) - addr = convert_memory_address (ptr_mode, addr); -#endif - + addr = convert_memory_address (ptr_mode, addr); emit_library_call (stack_check_libfunc, LCT_NORMAL, VOIDmode, 1, addr, ptr_mode); } diff --git a/gcc/expmed.c b/gcc/expmed.c index c59f8651b7b..6acc8956e26 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -4115,12 +4115,10 @@ make_tree (tree type, rtx x) t = make_node (RTL_EXPR); TREE_TYPE (t) = type; -#ifdef POINTERS_EXTEND_UNSIGNED /* If TYPE is a POINTER_TYPE, X might be Pmode with TYPE_MODE being ptr_mode. So convert. */ - if (POINTER_TYPE_P (type) && GET_MODE (x) != TYPE_MODE (type)) + if (POINTER_TYPE_P (type)) x = convert_memory_address (TYPE_MODE (type), x); -#endif RTL_EXPR_RTL (t) = x; /* There are no insns to be output diff --git a/gcc/expr.c b/gcc/expr.c index 0b6a93b3a16..5c055462a90 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -1957,10 +1957,8 @@ emit_block_move_via_libcall (rtx dst, rtx src, rtx size) dst_addr = copy_to_mode_reg (Pmode, XEXP (dst, 0)); src_addr = copy_to_mode_reg (Pmode, XEXP (src, 0)); -#ifdef POINTERS_EXTEND_UNSIGNED dst_addr = convert_memory_address (ptr_mode, dst_addr); src_addr = convert_memory_address (ptr_mode, src_addr); -#endif dst_tree = make_tree (ptr_type_node, dst_addr); src_tree = make_tree (ptr_type_node, src_addr); @@ -4299,11 +4297,8 @@ expand_assignment (tree to, tree from, int want_value) emit_block_move (to_rtx, value, expr_size (from), BLOCK_OP_NORMAL); else { -#ifdef POINTERS_EXTEND_UNSIGNED - if (POINTER_TYPE_P (TREE_TYPE (to)) - && GET_MODE (to_rtx) != GET_MODE (value)) + if (POINTER_TYPE_P (TREE_TYPE (to))) value = convert_memory_address (GET_MODE (to_rtx), value); -#endif emit_move_insn (to_rtx, value); } preserve_temp_slots (to_rtx); @@ -9228,11 +9223,8 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, if (modifier == EXPAND_SUM || modifier == EXPAND_INITIALIZER) { op0 = XEXP (op0, 0); -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE (op0) == Pmode && GET_MODE (op0) != mode - && mode == ptr_mode) + if (GET_MODE (op0) == Pmode && mode == ptr_mode) op0 = convert_memory_address (ptr_mode, op0); -#endif return op0; } @@ -9293,11 +9285,8 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, && ! REG_USERVAR_P (op0)) mark_reg_pointer (op0, TYPE_ALIGN (TREE_TYPE (type))); -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE (op0) == Pmode && GET_MODE (op0) != mode - && mode == ptr_mode) + if (GET_MODE (op0) == Pmode && mode == ptr_mode) op0 = convert_memory_address (ptr_mode, op0); -#endif return op0; diff --git a/gcc/function.c b/gcc/function.c index 29c84222071..344e31bc1e5 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -5182,11 +5182,7 @@ assign_parms (tree fndecl) rtx addr = DECL_RTL (function_result_decl); rtx x; -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE (addr) != Pmode) - addr = convert_memory_address (Pmode, addr); -#endif - + addr = convert_memory_address (Pmode, addr); x = gen_rtx_MEM (DECL_MODE (result), addr); set_mem_attributes (x, result, 1); SET_DECL_RTL (result, x); @@ -7069,12 +7065,9 @@ expand_function_end (void) assignment and USE below when inlining this function. */ REG_FUNCTION_VALUE_P (outgoing) = 1; -#ifdef POINTERS_EXTEND_UNSIGNED /* The address may be ptr_mode and OUTGOING may be Pmode. */ - if (GET_MODE (outgoing) != GET_MODE (value_address)) - value_address = convert_memory_address (GET_MODE (outgoing), - value_address); -#endif + value_address = convert_memory_address (GET_MODE (outgoing), + value_address); emit_move_insn (outgoing, value_address); diff --git a/gcc/integrate.c b/gcc/integrate.c index f0abe89f3e2..21a738ea237 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -2157,11 +2157,7 @@ copy_rtx_and_substitute (rtx orig, struct inline_remap *map, int for_lhs) #endif temp = XEXP (temp, 0); - -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE (temp) != GET_MODE (orig)) - temp = convert_memory_address (GET_MODE (orig), temp); -#endif + temp = convert_memory_address (GET_MODE (orig), temp); return temp; } else if (GET_CODE (constant) == LABEL_REF) diff --git a/gcc/stmt.c b/gcc/stmt.c index b62f83eccb3..18f46c818d6 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -520,10 +520,7 @@ expand_computed_goto (tree exp) { rtx x = expand_expr (exp, NULL_RTX, VOIDmode, 0); -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE (x) != Pmode) - x = convert_memory_address (Pmode, x); -#endif + x = convert_memory_address (Pmode, x); emit_queue (); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4315a0ffadf..878bcda49cc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-09-18 Mark Mitchell <mark@codesourcery.com> + + PR target/11184 + * gcc.dg/builtin-apply1.c: New test. + 2003-09-18 Nathan Sidwell <nathan@codesourcery.com> PR c++/9848 diff --git a/gcc/testsuite/gcc.dg/builtin-apply1.c b/gcc/testsuite/gcc.dg/builtin-apply1.c new file mode 100644 index 00000000000..38b384e7cca --- /dev/null +++ b/gcc/testsuite/gcc.dg/builtin-apply1.c @@ -0,0 +1,9 @@ +/* PR 11184 */ +/* Origin: Dara Hazeghi <dhazeghi@yahoo.com> */ + +void * +objc_msg_sendv (char * arg_frame, void (*foo)()) +{ + return __builtin_apply ( foo, arg_frame, 4); +} + |