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]
Other format: [Raw text]

Re: Fix SPARC64 ICE in function_arg_slotno (PR 31070)


On Wed, 20 Aug 2008, Eric Botcazou wrote:

> > 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.
>  
> I think that it would be slightly more consistent to handle them like
> struct S { int i; } or struct S { float f; }, which don't go through the 
> MODE_RANDOM case in function_arg_slotno.  Would that also work?

I originally considered putting MODE_VECTOR_INT in the MODE_FLOAT
case, but decided against that because I found that your patch
implementing vector calling conventions
<http://gcc.gnu.org/ml/gcc-patches/2004-11/msg00480.html> had removed
it from there.  If you now think adding it back there is the right
thing to do, however, this alternative patch follows that approach and
fixes the test in question; the other regression tests are still
running for it.

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)
@@ -4627,6 +4627,7 @@
     {
     case MODE_FLOAT:
     case MODE_COMPLEX_FLOAT:
+    case MODE_VECTOR_INT:
       if (TARGET_ARCH64 && TARGET_FPU && named)
 	{
 	  if (slotno >= SPARC_FP_ARG_MAX)

-- 
Joseph S. Myers
joseph@codesourcery.com


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