From 5efc661cc49cf7bd83fc805f91e02eefd44073e1 Mon Sep 17 00:00:00 2001
From: Richard Earnshaw <rearnsha@arm.com>
Date: Thu, 8 Aug 2013 13:34:45 +0000
Subject: [PATCH] re PR target/56979 (ICE in output_operand: invalid operand
 for code 'P')

	PR target/56979
	* arm.c (aapcs_vfp_allocate): Decompose the argument if the
	suggested mode for the assignment isn't compatible with the
	registers required.

From-SVN: r201598
---
 gcc/ChangeLog        | 7 +++++++
 gcc/config/arm/arm.c | 4 +++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4410a8ca1ef1..5645867fc74d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2013-08-08  Richard Earnshaw  <rearnsha@arm.com>
+
+	PR target/56979
+	* arm.c (aapcs_vfp_allocate): Decompose the argument if the
+	suggested mode for the assignment isn't compatible with the
+	registers required.
+
 2013-08-08  Bernd Edlinger  <bernd.edlinger@hotmail.de>
 
 	PR target/58065
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 8c1dce9478d9..f731bb60beb6 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -4544,7 +4544,9 @@ aapcs_vfp_allocate (CUMULATIVE_ARGS *pcum, enum machine_mode mode,
     if (((pcum->aapcs_vfp_regs_free >> regno) & mask) == mask)
       {
 	pcum->aapcs_vfp_reg_alloc = mask << regno;
-	if (mode == BLKmode || (mode == TImode && !TARGET_NEON))
+	if (mode == BLKmode
+	    || (mode == TImode && ! TARGET_NEON)
+	    || ! arm_hard_regno_mode_ok (FIRST_VFP_REGNUM + regno, mode))
 	  {
 	    int i;
 	    int rcount = pcum->aapcs_vfp_rcount;
-- 
GitLab