2018-05-15 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / ipa / pr58106.c
blobb83353c4e9af755aec50242dfa1aecd18a44e5b0
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" } */
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;
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)
18 rtx l = *x;
19 if (l == (rtx) 0)
22 rtx new_c, new_l;
23 for_each_rtx (&new_c, replace_label, data);
27 static int
28 for_each_rtx_1 (rtx exp, int n, rtx_function f, void *data)
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++)
35 switch (format[n])
37 case 'e':
38 result = (*f) (x, data);
40 result = for_each_rtx_1 (*x, i, f, data);
45 int
46 for_each_rtx (rtx *x, rtx_function f, void *data)
48 int i;
49 return for_each_rtx_1 (*x, i, f, data);