pdp11: return vector mode results in memory

Message ID 5D320055-2D90-40C3-ACC2-4E1C8724661A@dell.com
State New
Headers show

Commit Message

Paul Koning Nov. 1, 2010, 6:10 p.m.
pdp11 back end was trying to return vector modes in a register, if the component type was of a mode that does this.  But there aren't enough registers for that, resulting in ICE in a couple of test cases.  This patch changes vectors (and complex) to be memory returns.

Tested by build, make check.  Committed.



2010-11-01  Paul Koning  <ni1d@arrl.net>

	* config/pdp11/pdp11.c (pdp11_return_in_memory): Return vector and
	complex modes in memory.


Index: config/pdp11/pdp11.c
--- config/pdp11/pdp11.c	(revision 166133)
+++ config/pdp11/pdp11.c	(working copy)
@@ -1816,14 +1816,12 @@ 
 static bool
 pdp11_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
-  /* Should probably return DImode and DFmode in memory, lest
-     we fill up all regs!
-     have to, else we crash - exception: maybe return result in 
-     ac0 if DFmode and FPU present - compatibility problem with
-     libraries for non-floating point....  */
+  /* Integers 32 bits and under, and scalar floats (if FPU), are returned
+     in registers.  The rest go into memory.  */
   return (TYPE_MODE (type) == DImode
-	  || (FLOAT_MODE_P (TYPE_MODE (type)) && ! TARGET_AC0));
+	  || (FLOAT_MODE_P (TYPE_MODE (type)) && ! TARGET_AC0)
+	  || TREE_CODE (type) == VECTOR_TYPE
+	  || COMPLEX_MODE_P (TYPE_MODE (type)));
 /* Worker function for TARGET_FUNCTION_VALUE.