diff mbox

Fix PR middle-end/65409

Message ID 44582958.KU38Ob0FdW@polaris
State New
Headers show

Commit Message

Eric Botcazou March 16, 2015, 10:23 a.m. UTC
This is an ICE present on all active branches, a regression introduced by the 
overhaul I applied throughout the RTL expander to avoid creating unnecessary 
stack temporaries for return values.  We enter the special block for MEM:BLK 
in store_field with a PARALLEL:BLK and abort on the assertion.  This RTX is 
dealt with immediately below and, as discussed with Jakub in the audit trail, 
adding the obvious guard is the safest thing to do for the release branches.

Tested on x86_64-suse-linux, applied on all active branches.


2015-03-16  Eric Botcazou  <ebotcazou@adacore.com>

	PR middle-end/65409
	* expr.c (store_field): Do not do a direct block copy if the source is
	a PARALLEL with BLKmode.


2015-03-16  Eric Botcazou  <ebotcazou@adacore.com>

	* testsuite/g++.dg/pr65049.C: New test.
diff mbox

Patch

Index: expr.c
===================================================================
--- expr.c	(revision 221407)
+++ expr.c	(working copy)
@@ -6645,11 +6645,12 @@  store_field (rtx target, HOST_WIDE_INT b
 	  && mode != TYPE_MODE (TREE_TYPE (exp)))
 	temp = convert_modes (mode, TYPE_MODE (TREE_TYPE (exp)), temp, 1);
 
-      /* If the modes of TEMP and TARGET are both BLKmode, both
-	 must be in memory and BITPOS must be aligned on a byte
-	 boundary.  If so, we simply do a block copy.  Likewise
-	 for a BLKmode-like TARGET.  */
-      if (GET_MODE (temp) == BLKmode
+      /* If TEMP is not a PARALLEL (see below) and its mode and that of TARGET
+	 are both BLKmode, both must be in memory and BITPOS must be aligned
+	 on a byte boundary.  If so, we simply do a block copy.  Likewise for
+	 a BLKmode-like TARGET.  */
+      if (GET_CODE (temp) != PARALLEL
+	  && GET_MODE (temp) == BLKmode
 	  && (GET_MODE (target) == BLKmode
 	      || (MEM_P (target)
 		  && GET_MODE_CLASS (GET_MODE (target)) == MODE_INT