| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-additional-options "-O2 -fdump-tree-threadfull1-details --param logical-op-non-short-circuit=1" } */ |
| 3 |
/* { dg-final { scan-tree-dump-times "Registering jump" 8 "threadfull1" } } */ |
| 4 |
|
| 5 |
/* Copied from ssa-thread-14. */ |
| 6 |
|
| 7 |
void foo (void); |
| 8 |
void bar (void); |
| 9 |
void blah (void); |
| 10 |
|
| 11 |
/* One jump threaded here. */ |
| 12 |
|
| 13 |
void |
| 14 |
baz_1 (int a, int b, int c) |
| 15 |
{ |
| 16 |
if (a && b) |
| 17 |
foo (); |
| 18 |
if (!b && c) |
| 19 |
bar (); |
| 20 |
} |
| 21 |
|
| 22 |
/* One jump threaded here. */ |
| 23 |
|
| 24 |
void |
| 25 |
baz_2 (int a, int b, int c) |
| 26 |
{ |
| 27 |
if (a && b) |
| 28 |
foo (); |
| 29 |
if (b || c) |
| 30 |
bar (); |
| 31 |
} |
| 32 |
|
| 33 |
/* One jump threaded here. */ |
| 34 |
|
| 35 |
void |
| 36 |
baz_3 (int a, int b, int c) |
| 37 |
{ |
| 38 |
if (a && b > 10) |
| 39 |
foo (); |
| 40 |
if (b < 5 && c) |
| 41 |
bar (); |
| 42 |
} |
| 43 |
|
| 44 |
/* Two jumps threaded here. */ |
| 45 |
|
| 46 |
void |
| 47 |
baz_4 (int a, int b, int c) |
| 48 |
{ |
| 49 |
if (a && b) |
| 50 |
{ |
| 51 |
foo (); |
| 52 |
if (c) |
| 53 |
bar (); |
| 54 |
} |
| 55 |
if (b && c) |
| 56 |
blah (); |
| 57 |
} |
| 58 |
|
| 59 |
/* Two jumps threaded here. */ |
| 60 |
|
| 61 |
void |
| 62 |
baz_5 (int a, int b, int c) |
| 63 |
{ |
| 64 |
if (a && b) |
| 65 |
{ |
| 66 |
foo (); |
| 67 |
if (c) |
| 68 |
bar (); |
| 69 |
} |
| 70 |
if (!b || !c) |
| 71 |
blah (); |
| 72 |
} |
| 73 |
|
| 74 |
/* One jump threaded here. */ |
| 75 |
|
| 76 |
void |
| 77 |
baz_6 (int a, int b, int c) |
| 78 |
{ |
| 79 |
if (a == 39 && b == 41) |
| 80 |
foo (); |
| 81 |
if (c == 12 || b == 41) |
| 82 |
bar (); |
| 83 |
} |