libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-thread-invalid.c
blobbd56a62a4b468df71105d6dd3e63d90cae4d0acc
1 // { dg-do compile }
2 // { dg-options "-O2 -fgimple -fdump-statistics" }
3 //
4 // This is a collection of seemingly threadble paths that should not be allowed.
6 void foobar (int);
8 // Possible thread from 2->4->3, but it would rotate the loop.
9 void __GIMPLE (ssa)
10 f1 ()
12 int i;
14 // Pre-header.
15 __BB(2):
16 goto __BB4;
18 // Latch.
19 __BB(3):
20 foobar (i_1);
21 i_5 = i_1 + 1;
22 goto __BB4;
24 __BB(4,loop_header(1)):
25 i_1 = __PHI (__BB2: 0, __BB3: i_5);
26 if (i_1 != 101)
27 goto __BB3;
28 else
29 goto __BB5;
31 __BB(5):
32 return;
36 // Possible thread from 2->3->5 but threading through the empty latch
37 // would create a non-empty latch.
38 void __GIMPLE (ssa)
39 f2 ()
41 int i;
43 // Pre-header.
44 __BB(2):
45 goto __BB3;
47 __BB(3,loop_header(1)):
48 i_8 = __PHI (__BB5: i_5, __BB2: 0);
49 foobar (i_8);
50 i_5 = i_8 + 1;
51 if (i_5 != 256)
52 goto __BB5;
53 else
54 goto __BB4;
56 // Latch.
57 __BB(5):
58 goto __BB3;
60 __BB(4):
61 return;
65 // Possible thread from 3->5->6->3 but this would thread through the
66 // header but not exit the loop.
67 int __GIMPLE (ssa)
68 f3 (int a)
70 int i;
72 __BB(2):
73 goto __BB6;
75 __BB(3):
76 if (i_1 != 0)
77 goto __BB4;
78 else
79 goto __BB5;
81 __BB(4):
82 foobar (5);
83 goto __BB5;
85 // Latch.
86 __BB(5):
87 i_7 = i_1 + 1;
88 goto __BB6;
90 __BB(6,loop_header(1)):
91 i_1 = __PHI (__BB2: 1, __BB5: i_7);
92 if (i_1 <= 99)
93 goto __BB3;
94 else
95 goto __BB7;
97 __BB(7):
98 return;
102 // { dg-final { scan-tree-dump-not "Jumps threaded" "statistics" } }