| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O1" } */ |
| 3 |
|
| 4 |
int *ptr; |
| 5 |
int *fn1 (int *); |
| 6 |
int fn2 (int, int); |
| 7 |
int fn3 (void); |
| 8 |
int fn4 (int); |
| 9 |
|
| 10 |
static int |
| 11 |
foo (int x, int y, int z) |
| 12 |
{ |
| 13 |
int b; |
| 14 |
asm ("" : "=a" (b), "=&d" (x) : "0" (y), "1" (x), "mr" (z)); |
| 15 |
return x; |
| 16 |
} |
| 17 |
|
| 18 |
static int |
| 19 |
bar (int x, int y) |
| 20 |
{ |
| 21 |
int a; |
| 22 |
if (!y) |
| 23 |
{ |
| 24 |
for (a = 0; a <= (x >> 1); ) |
| 25 |
; |
| 26 |
a = foo (y, fn2 (2, x), x); |
| 27 |
if (x) |
| 28 |
a = x; |
| 29 |
return a; |
| 30 |
} |
| 31 |
} |
| 32 |
|
| 33 |
static int |
| 34 |
baz (int x, int y) |
| 35 |
{ |
| 36 |
int *a = ptr; |
| 37 |
int t, xk1 = fn3 (), xk = x * xk1; |
| 38 |
for (t = 0; t < xk; t += xk1) |
| 39 |
{ |
| 40 |
if (fn4 (a[2])) |
| 41 |
return -y; |
| 42 |
a = fn1 (a); |
| 43 |
} |
| 44 |
return 0; |
| 45 |
} |
| 46 |
|
| 47 |
void |
| 48 |
test (int x, long y, int z) |
| 49 |
{ |
| 50 |
int a = fn3 (); |
| 51 |
int b; |
| 52 |
int c = bar (x, z); |
| 53 |
for (b = 0; b <= y; b++) |
| 54 |
c = baz (x, c); |
| 55 |
fn2 (c, a); |
| 56 |
} |