aboutsummaryrefslogtreecommitdiff
path: root/gcc/calls.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2017-03-29 14:18:07 +0000
committerAndreas Schwab <schwab@gcc.gnu.org>2017-03-29 14:18:07 +0000
commit84355514f445ca2c7e3de1e05b8d2a2993f96cbc (patch)
tree8e4f21eb7ac81a2802f717ea0f1acea6623b9f14 /gcc/calls.c
parent8777357cb5a467b31ebeb4eaa6588a1d9fb8546e (diff)
downloadgcc-84355514f445ca2c7e3de1e05b8d2a2993f96cbc.zip
gcc-84355514f445ca2c7e3de1e05b8d2a2993f96cbc.tar.gz
gcc-84355514f445ca2c7e3de1e05b8d2a2993f96cbc.tar.bz2
re PR ada/80146 (ICE in copy_to_mode_reg, at explow.c:612)
PR ada/80146 * calls.c (prepare_call_address): Convert funexp to Pmode before copying to temp reg. From-SVN: r246570
Diffstat (limited to 'gcc/calls.c')
-rw-r--r--gcc/calls.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/calls.c b/gcc/calls.c
index 61caf4c..c92e35e 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -206,6 +206,9 @@ prepare_call_address (tree fndecl_or_type, rtx funexp, rtx static_chain_value,
DECL_STATIC_CHAIN (fndecl_or_type) = 1;
rtx chain = targetm.calls.static_chain (fndecl_or_type, false);
+ if (GET_MODE (funexp) != Pmode)
+ funexp = convert_memory_address (Pmode, funexp);
+
/* Avoid long live ranges around function calls. */
funexp = copy_to_mode_reg (Pmode, funexp);