summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/sra-11.c
blob: c8a90eac59d25c9288a5cb7c2147e80b18f265e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-esra-details" } */

struct S
{
  int i;
  int j;
  char c[32]; /* this disables total scalarization */
};

extern struct S bar(void);

int foo1 (int b)
{
   struct S s1;

   s1 = bar ();
   return s1.i;
}

extern struct S *g;

int foo2 (void)
{
   struct S s2;

   s2 = *g;
   return s2.i;
}

/* { dg-final { scan-tree-dump-times "Created a replacement for s1" 0 "esra"} } */
/* { dg-final { scan-tree-dump-times "Created a replacement for s2" 1 "esra"} } */
/* { dg-final { cleanup-tree-dump "esra" } } */