1 /* { dg-do compile { target { ! { logical_op_short_circuit || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* hppa*-*-* nios2*-*-* riscv*-*-* } } } } }  */
2 /* { dg-additional-options "-O2 -fdump-tree-vrp-details" }  */
3 /* { dg-additional-options "-mbranch-cost=2" { target i?86-*-* x86_64-*-* } }  */
4 /* { dg-final { scan-tree-dump-times "Threaded jump" 8 "vrp1" } }  */
5 
6 void foo (void);
7 void bar (void);
8 void blah (void);
9 
10 /* One jump threaded here.  */
11 
12 void
baz_1(int a,int b,int c)13 baz_1 (int a, int b, int c)
14 {
15   if (a && b)
16     foo ();
17   if (!b && c)
18     bar ();
19 }
20 
21 /* One jump threaded here.  */
22 
23 void
baz_2(int a,int b,int c)24 baz_2 (int a, int b, int c)
25 {
26   if (a && b)
27     foo ();
28   if (b || c)
29     bar ();
30 }
31 
32 /* One jump threaded here.  */
33 
34 void
baz_3(int a,int b,int c)35 baz_3 (int a, int b, int c)
36 {
37   if (a && b > 10)
38     foo ();
39   if (b < 5 && c)
40     bar ();
41 }
42 
43 /* Two jumps threaded here.  */
44 
45 void
baz_4(int a,int b,int c)46 baz_4 (int a, int b, int c)
47 {
48   if (a && b)
49     {
50       foo ();
51       if (c)
52         bar ();
53     }
54   if (b && c)
55     blah ();
56 }
57 
58 /* Two jumps threaded here.  */
59 
60 void
baz_5(int a,int b,int c)61 baz_5 (int a, int b, int c)
62 {
63   if (a && b)
64     {
65       foo ();
66       if (c)
67         bar ();
68     }
69   if (!b || !c)
70     blah ();
71 }
72 
73 /* One jump threaded here.  */
74 
75 void
baz_6(int a,int b,int c)76 baz_6 (int a, int b, int c)
77 {
78   if (a == 39 && b == 41)
79     foo ();
80   if (c == 12 || b == 41)
81     bar ();
82 }
83