| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-O2 -fno-tree-fre -fno-tree-sra -fdump-tree-optimized-slim" } */ |
| 3 |
|
| 4 |
struct S |
| 5 |
{ |
| 6 |
int a, b, c; |
| 7 |
}; |
| 8 |
|
| 9 |
volatile int z1; |
| 10 |
int z2 = 44; |
| 11 |
|
| 12 |
void __attribute__((noipa)) |
| 13 |
use_int (int c) |
| 14 |
{ |
| 15 |
z1 = c; |
| 16 |
} |
| 17 |
|
| 18 |
static void __attribute__ ((noinline)) |
| 19 |
bar (struct S s) |
| 20 |
{ |
| 21 |
use_int (s.c); |
| 22 |
} |
| 23 |
|
| 24 |
|
| 25 |
static void __attribute__ ((noinline)) |
| 26 |
foo (struct S s) |
| 27 |
{ |
| 28 |
int c = s.c; |
| 29 |
if (c != 21) |
| 30 |
use_int (c); |
| 31 |
|
| 32 |
s.c = z2; |
| 33 |
bar (s); |
| 34 |
if (s.c != 44) |
| 35 |
__builtin_abort (); |
| 36 |
} |
| 37 |
|
| 38 |
int |
| 39 |
main (void) |
| 40 |
{ |
| 41 |
struct S s; |
| 42 |
s.a = 1; |
| 43 |
s.b = 64; |
| 44 |
s.c = 21; |
| 45 |
foo (s); |
| 46 |
return 0; |
| 47 |
} |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
/* { dg-final { scan-tree-dump-not "ellide" "optimized" } } */ |