re PR ada/80146 (ICE in copy_to_mode_reg, at explow.c:612)
authorAndreas Schwab <schwab@suse.de>
Wed, 29 Mar 2017 14:18:07 +0000 (14:18 +0000)
committerAndreas Schwab <schwab@gcc.gnu.org>
Wed, 29 Mar 2017 14:18:07 +0000 (14:18 +0000)
PR ada/80146
* calls.c (prepare_call_address): Convert funexp to Pmode before
copying to temp reg.

From-SVN: r246570

gcc/ChangeLog
gcc/calls.c

index f41a1d5533d1546cde1f4dbb50035bad07e1b1c9..bbac099a2c8cea5fc990e00e3e825c2c0f8659e8 100644 (file)
@@ -1,3 +1,9 @@
+2017-03-29  Andreas Schwab  <schwab@suse.de>
+
+       PR ada/80146
+       * calls.c (prepare_call_address): Convert funexp to Pmode before
+       copying to temp reg.
+
 2017-03-29  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
        PR tree-optimization/80158
index 61caf4ca752ccabdd4c6b6733cbe925b34cbdc7d..c92e35ea5a8d77f8bebfcaa5112c127b629c26a0 100644 (file)
@@ -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);