OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [nrv3.c] - Blame information for rev 754

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* Verify that gimple-level NRV is occurring when values other than the
2
   return slot are call-clobbered.  */
3
/* { dg-do compile } */
4
/* { dg-options "-O -fdump-tree-optimized" } */
5
 
6
#ifdef __SPU__
7
/* SPU returns aggregates up to 1172 bytes in registers.  */
8
typedef struct { int x[300]; void *y; } S;
9
#else
10
typedef struct { int x[20]; void *y; } S;
11
#endif
12
typedef struct { int a; S b; } T;
13
S nrv_candidate (void);
14
void use_result (S, int);
15
int *ptr;
16
void foo (void)
17
{
18
  S result;
19
  T result_arr[10][5];
20
 
21
  int i;
22
 
23
  ptr = &i;
24
 
25
  /* i is call-clobbered for these calls, but result and result_arr
26
     aren't.  */
27
  result = nrv_candidate ();
28
  result_arr[3][4].b = nrv_candidate ();
29
 
30
  use_result (result, i);
31
  use_result (result_arr[3][4].b, i);
32
}
33
 
34
/* { dg-final { scan-tree-dump-times "return slot optimization" 2 "optimized" } } */
35
/* { dg-final { cleanup-tree-dump "optimized" } } */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.