| 1 |
/* PR 58106 testcase. Verify that rdesc chain creating and lookup works with |
| 2 |
recursive inlining and master clone creation. */ |
| 3 |
/* { dg-do compile } */ |
| 4 |
/* { dg-options "-O3" } */ |
| 5 |
|
| 6 |
typedef struct rtx_def *rtx; |
| 7 |
enum rtx_code { |
| 8 |
LAST_AND_UNUSED_RTX_CODE}; |
| 9 |
extern const char * const rtx_format[((int) LAST_AND_UNUSED_RTX_CODE)]; |
| 10 |
struct rtx_def { |
| 11 |
enum rtx_code code; |
| 12 |
}; |
| 13 |
typedef int (*rtx_function) (rtx *, void *); |
| 14 |
extern int for_each_rtx (rtx *, rtx_function, void *); |
| 15 |
int |
| 16 |
replace_label (rtx *x, void *data) |
| 17 |
{ |
| 18 |
rtx l = *x; |
| 19 |
if (l == (rtx) 0) |
| 20 |
{ |
| 21 |
{ |
| 22 |
rtx new_c, new_l; |
| 23 |
for_each_rtx (&new_c, replace_label, data); |
| 24 |
} |
| 25 |
} |
| 26 |
} |
| 27 |
static int |
| 28 |
for_each_rtx_1 (rtx exp, int n, rtx_function f, void *data) |
| 29 |
{ |
| 30 |
int result, i, j; |
| 31 |
const char *format = (rtx_format[(int) (((enum rtx_code) (exp)->code))]); |
| 32 |
rtx *x; |
| 33 |
for (; format[n] != '\0'; n++) |
| 34 |
{ |
| 35 |
switch (format[n]) |
| 36 |
{ |
| 37 |
case 'e': |
| 38 |
result = (*f) (x, data); |
| 39 |
{ |
| 40 |
result = for_each_rtx_1 (*x, i, f, data); |
| 41 |
} |
| 42 |
} |
| 43 |
} |
| 44 |
} |
| 45 |
int |
| 46 |
for_each_rtx (rtx *x, rtx_function f, void *data) |
| 47 |
{ |
| 48 |
int i; |
| 49 |
return for_each_rtx_1 (*x, i, f, data); |
| 50 |
} |