1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-dom2-details" } */
3 
4 void foo();
5 void bla();
6 void bar();
7 
8 /* Avoid threading in the following case, to prevent creating subloops.  */
9 
dont_thread_2(int first)10 void dont_thread_2 (int first)
11 {
12   int i = 0;
13 
14   do
15     {
16       if (first)
17 	foo ();
18       else
19 	bar ();
20 
21       first = 0;
22       bla ();
23     } while (i++ < 100);
24 }
25 
26 /* Peeling off the first iteration would make threading through
27    the loop latch safe, but we don't do that currently.  */
28 /* { dg-final { scan-tree-dump-not "IRREDUCIBLE_LOOP" "dom2" } } */
29