OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [nrv3.c] - Blame information for rev 645

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

Line No. Rev Author Line
1 149 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
typedef struct { int x[20]; void *y; } S;
7
typedef struct { int a; S b; } T;
8
S nrv_candidate (void);
9
void use_result (S, int);
10
int *ptr;
11
void foo (void)
12
{
13
  S result;
14
  T result_arr[10][5];
15
 
16
  int i;
17
 
18
  ptr = &i;
19
 
20
  /* i is call-clobbered for these calls, but result and result_arr
21
     aren't.  */
22
  result = nrv_candidate ();
23
  result_arr[3][4].b = nrv_candidate ();
24
 
25
  use_result (result, i);
26
  use_result (result_arr[3][4].b, i);
27
}
28
 
29
/* { dg-final { scan-tree-dump-times "return slot optimization" 2 "optimized" } } */
30
/* { 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.