summaryrefslogtreecommitdiff
path: root/gcc/calls.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/calls.c')
-rw-r--r--gcc/calls.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/gcc/calls.c b/gcc/calls.c
index 4969cd10202..a0c451c42fd 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -1673,21 +1673,19 @@ rtx_for_function_call (fndecl, exp)
{
rtx funaddr;
push_temp_slots ();
- funaddr = funexp =
- expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, VOIDmode, 0);
+ funaddr = funexp
+ = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, VOIDmode, 0);
pop_temp_slots (); /* FUNEXP can't be BLKmode. */
/* Check the function is executable. */
if (current_function_check_memory_usage)
{
#ifdef POINTERS_EXTEND_UNSIGNED
- /* It might be OK to convert funexp in place, but there's
- a lot going on between here and when it happens naturally
- that this seems safer. */
- funaddr = convert_memory_address (Pmode, funexp);
+ if (GET_MODE (funexp) != ptr_mode)
+ funaddr = convert_memory_address (ptr_mode, funexp);
#endif
emit_library_call (chkr_check_exec_libfunc, LCT_CONST_MAKE_BLOCK,
- VOIDmode, 1, funaddr, Pmode);
+ VOIDmode, 1, funaddr, ptr_mode);
}
emit_queue ();
}