1// { dg-do assemble  }
2
3// Test of severe performance regression from 2.95.  This code generates
4// a heavily self-referential tree which caused the inliner to take
5// O(3**N) time to scan it for function calls.
6// Reported by Kelley Cook <kelley.cook@home.com>.  PR c++/1687.
7
8bool in0 ;
9bool in1 ;
10bool in2 ;
11bool in3 ;
12bool in4 ;
13bool in5 ;
14bool in6 ;
15bool in7 ;
16bool in8 ;
17bool in9 ;
18bool in10;
19bool in11;
20bool in12;
21bool in13;
22bool in14;
23bool in15;
24bool in16;
25bool in17;
26bool in18;
27bool in19;
28bool in20;
29bool in21;
30bool in22;
31bool in23;
32bool in24;
33bool in25;
34bool in26;
35bool in27;
36bool in28;
37bool in29;
38bool in30;
39bool in31;
40unsigned long output;
41
42void mux(void)
43{
44  output =
45      (in0   ?  0x00000001 : 0) |
46      (in1   ?  0x00000002 : 0) |
47      (in2   ?  0x00000004 : 0) |
48      (in3   ?  0x00000008 : 0) |
49      (in4   ?  0x00000010 : 0) |
50      (in5   ?  0x00000020 : 0) |
51      (in6   ?  0x00000040 : 0) |
52      (in7   ?  0x00000080 : 0) |
53      (in8   ?  0x00000100 : 0) |
54      (in9   ?  0x00000200 : 0) |
55      (in10  ?  0x00000400 : 0) |
56      (in11  ?  0x00000800 : 0) |
57      (in12  ?  0x00001000 : 0) |
58      (in13  ?  0x00002000 : 0) |
59      (in14  ?  0x00004000 : 0) |
60      (in15  ?  0x00008000 : 0) |
61      (in16  ?  0x00010000 : 0) |
62      (in17  ?  0x00020000 : 0) |
63      (in18  ?  0x00040000 : 0) |
64      (in19  ?  0x00080000 : 0) |
65      (in20  ?  0x00100000 : 0) |
66      (in21  ?  0x00200000 : 0) |
67      (in22  ?  0x00400000 : 0) |
68      (in23  ?  0x00800000 : 0) |
69      (in24  ?  0x01000000 : 0) |
70      (in25  ?  0x02000000 : 0) |
71      (in26  ?  0x04000000 : 0) |
72      (in27  ?  0x08000000 : 0) |
73      (in28  ?  0x10000000 : 0) |
74      (in29  ?  0x20000000 : 0) |
75      (in30  ?  0x40000000 : 0) |
76      (in31  ?  0x80000000 : 0) ;
77}
78
79