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]

[PATCH, testsuite] Fix pass-by-reference related tests for SPU


Hello,

this fixes two test cases that FAIL on SPU because on this platform,
very large aggregates (up to 1172 bytes) are passed in registers.

Both test cases rely on an aggregate being passed by reference, however.
They try to enforce this by adding padding to make the aggregate "big"
-- unfortunately it's still not big enough for the SPU.

The patch below simply increases the padding size to ensure that even
on the SPU, the aggregate has to be passed by reference.

Tested on spu-elf with no regression, fixes all FAILs in the test
cases touched by the patch.

OK for mainline and the 4.3 branch?

Bye,
Ulrich


ChangeLog:

	* gcc.dg/nrv3.c (S): Increase size of padding for SPU.
	* g++.dg/opt/temp1.C (struct T): Likewise.


Index: gcc/testsuite/gcc.dg/nrv3.c
===================================================================
*** gcc/testsuite/gcc.dg/nrv3.c	(revision 136680)
--- gcc/testsuite/gcc.dg/nrv3.c	(working copy)
***************
*** 3,9 ****
--- 3,14 ----
  /* { dg-do compile } */
  /* { dg-options "-O -fdump-tree-optimized" } */
  
+ #ifdef __SPU__
+ /* SPU returns aggregates up to 1172 bytes in registers.  */
+ typedef struct { int x[300]; void *y; } S;
+ #else
  typedef struct { int x[20]; void *y; } S;
+ #endif
  typedef struct { int a; S b; } T;
  S nrv_candidate (void);
  void use_result (S, int);
Index: gcc/testsuite/g++.dg/opt/temp1.C
===================================================================
*** gcc/testsuite/g++.dg/opt/temp1.C	(revision 136680)
--- gcc/testsuite/g++.dg/opt/temp1.C	(working copy)
*************** void *memcpy (void *dest, const void *sr
*** 24,30 ****
--- 24,35 ----
  }
   
  struct T {
+ #ifdef __SPU__
+   /* SPU returns aggregates up to 1172 bytes in registers.  */
+   int a[300];
+ #else
    int a[128];
+ #endif
    T &operator+=(T const &v) __attribute__((noinline));
    T operator+(T const &v) const { T t = *this; t += v; return t; }
  };
-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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