This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] Allow RESULT_DECLs passed in multiple non-contiguous locations in ADDR_EXPR


Hi!

g++.benjamin/p13417.C ICEs on sparc64. The reason is that there is an
ADDR_EXPR with arg0 RESULT_DECL passed in multiple non-contiguous locations
passed to expand_expr. The patch below seems to fix it.
Ok to commit?

2000-11-04  Jakub Jelinek  <jakub@redhat.com>

	* expr.c (expand_expr) [ADDR_EXPR]: Handle when op0 is RETURN_DECL
	passed in multiple non-contiguous locations.

--- gcc/expr.c.jj	Tue Oct 31 18:00:42 2000
+++ gcc/expr.c	Sat Nov  4 22:52:38 2000
@@ -8387,7 +8387,8 @@ expand_expr (exp, target, tmode, modifie
 	    }
 
 	  else if (GET_CODE (op0) == REG || GET_CODE (op0) == SUBREG
-		   || GET_CODE (op0) == CONCAT || GET_CODE (op0) == ADDRESSOF)
+		   || GET_CODE (op0) == CONCAT || GET_CODE (op0) == ADDRESSOF
+		   || GET_CODE (op0) == PARALLEL)
 	    {
 	      /* If this object is in a register, it must be not
 		 be BLKmode.  */
@@ -8395,7 +8396,14 @@ expand_expr (exp, target, tmode, modifie
 	      rtx memloc = assign_temp (inner_type, 1, 1, 1);
 
 	      mark_temp_addr_taken (memloc);
-	      emit_move_insn (memloc, op0);
+	      if (GET_CODE (op0) == PARALLEL)
+		/* Handle calls that pass values in multiple non-contiguous
+		   locations.  The Irix 6 ABI has examples of this.  */
+		emit_group_store (memloc, op0,
+				  int_size_in_bytes (inner_type),
+				  TYPE_ALIGN (inner_type));
+	      else
+		emit_move_insn (memloc, op0);
 	      op0 = memloc;
 	    }
 
	Jakub

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]