| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fdump-tree-pre -fno-code-hoisting" } */ |
| 3 |
|
| 4 |
int foo (int i, int j, int b) |
| 5 |
{ |
| 6 |
int res = 0; |
| 7 |
if (b) |
| 8 |
res = i/j; |
| 9 |
/* We should insert the possibly trapping i/j. */ |
| 10 |
res += i/j; |
| 11 |
return res; |
| 12 |
} |
| 13 |
|
| 14 |
extern void bar (void); |
| 15 |
int foo2 (int i, int j, int b) |
| 16 |
{ |
| 17 |
int res = 0; |
| 18 |
if (b) |
| 19 |
res = i/j; |
| 20 |
/* And here, the possibly not returning call in the same basic-block |
| 21 |
comes after the trapping i/j. */ |
| 22 |
res += i/j; |
| 23 |
bar (); |
| 24 |
return res; |
| 25 |
} |
| 26 |
|
| 27 |
/* { dg-final { scan-tree-dump-times "# prephitmp" 2 "pre" } } */ |