Fix SPARC64 ICE in function_arg_slotno (PR 31070)

Joseph S. Myers joseph@codesourcery.com
Wed Aug 20 20:19:00 GMT 2008


This patch fixes the following test failures for sparc64-linux-gnu,
making the test PASS on execution.

FAIL: tmpdir-g++.dg-struct-layout-1/t026 cp_compat_x_tst.o compile,  (internal compiler error)
FAIL: tmpdir-g++.dg-struct-layout-1/t026 cp_compat_y_tst.o compile,  (internal compiler error)
UNRESOLVED: tmpdir-g++.dg-struct-layout-1/t026 cp_compat_x_tst.o-cp_compat_y_tst.o link 
UNRESOLVED: tmpdir-g++.dg-struct-layout-1/t026 cp_compat_x_tst.o-cp_compat_y_tst.o execute 

The problem argument has type struct S2400 { v8qi a; }, with a vector
integer mode but a structure rather than a vector type, so the code
causing vectors of integers to be handled like floating-point types
doesn't come into play.  I couldn't find documentation of the ABI
Sun's compiler might use in this case, or of the API for any Sun
vector extensions we are trying to be compatible with, and don't have
access to any such Sun compiler, but handling such structures in the
structure case seems consistent with the comments in the SPARC back
end: the structure element will be extracted and go through the
processing done on elements of structures being passed as arguments,
resulting in it being handled like a structure containing a
floating-point value would be.

Tested with no regressions with cross to sparc64-linux-gnu.  OK to
commit?

2008-08-20  Joseph Myers  <joseph@codesourcery.com>

	PR target/31070
	* config/sparc/sparc.c (function_arg_slotno): Handle structure
	with MODE_VECTOR_INT mode.

Index: config/sparc/sparc.c
===================================================================
--- config/sparc/sparc.c	(revision 139084)
+++ config/sparc/sparc.c	(working copy)
@@ -4648,11 +4648,16 @@
       break;
 
     case MODE_RANDOM:
+    case MODE_VECTOR_INT:
       if (mode == VOIDmode)
 	/* MODE is VOIDmode when generating the actual call.  */
 	return -1;
 
-      gcc_assert (mode == BLKmode);
+      gcc_assert (mode == BLKmode
+		  || (TARGET_ARCH64
+		      && mclass == MODE_VECTOR_INT
+		      && type
+		      && TREE_CODE (type) == RECORD_TYPE));
 
       if (TARGET_ARCH32
 	  || !type

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Gcc-patches mailing list