| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fdump-tree-cddce2 -fno-finite-loops" } */ |
| 3 |
|
| 4 |
struct rtx_def; |
| 5 |
typedef struct rtx_def *rtx; |
| 6 |
extern const char rtx_class[]; |
| 7 |
void foo (void); |
| 8 |
union rtunion_def |
| 9 |
{ |
| 10 |
rtx rtx; |
| 11 |
}; |
| 12 |
typedef union rtunion_def rtunion; |
| 13 |
struct rtx_def |
| 14 |
{ |
| 15 |
int code; |
| 16 |
rtunion fld[1]; |
| 17 |
}; |
| 18 |
static int |
| 19 |
can_move_up (rtx insn, int n_insns) |
| 20 |
{ |
| 21 |
while (n_insns > 0) |
| 22 |
{ |
| 23 |
insn = (((insn)->fld[1]).rtx); |
| 24 |
if (((rtx_class[(int) (((insn)->code))]) == 'i')) |
| 25 |
n_insns--; |
| 26 |
} |
| 27 |
return n_insns <= 0; |
| 28 |
} |
| 29 |
int |
| 30 |
com (rtx insn, int blah) |
| 31 |
{ |
| 32 |
if (!can_move_up (insn, blah)) |
| 33 |
foo (); |
| 34 |
} |
| 35 |
|
| 36 |
/* Cddce cannot remove possibly infinite loops and there is no way how to |
| 37 |
determine whether the loop in can_move_up ends. */ |
| 38 |
/* { dg-final { scan-tree-dump "if " "cddce2"} } */ |