1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
|
commit dd9992d1b96b5811873c98a208c029bebb0c3577
Author: law <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed Sep 20 05:35:07 2017 +0000
* config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): New.
(ix86_expand_prologue): Dump stack clash info as needed.
Call ix86_adjust_stack_and_probe_stack_clash as needed.
* gcc.dg/stack-check-4.c: New test.
* gcc.dg/stack-check-5.c: New test.
* gcc.dg/stack-check-6.c: New test.
* gcc.dg/stack-check-6a.c: New test.
* gcc.dg/stack-check-7.c: New test.
* gcc.dg/stack-check-8.c: New test.
* gcc.dg/stack-check-9.c: New test.
* gcc.dg/stack-check-10.c: New test.
* lib/target-supports.exp
(check_effective_target_supports_stack_clash_protection): Enable for
x86 and x86_64 targets.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@252998 138bc75d-0d04-0410-961f-82ee72b054a4
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index d996fd160e8..a555b0774c0 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -9839,6 +9839,147 @@ release_scratch_register_on_entry (struct scratch_reg *sr)
#define PROBE_INTERVAL (1 << STACK_CHECK_PROBE_INTERVAL_EXP)
+/* Emit code to adjust the stack pointer by SIZE bytes while probing it.
+
+ This differs from the next routine in that it tries hard to prevent
+ attacks that jump the stack guard. Thus it is never allowed to allocate
+ more than PROBE_INTERVAL bytes of stack space without a suitable
+ probe. */
+
+static void
+ix86_adjust_stack_and_probe_stack_clash (const HOST_WIDE_INT size)
+{
+ struct machine_function *m = cfun->machine;
+
+ /* If this function does not statically allocate stack space, then
+ no probes are needed. */
+ if (!size)
+ {
+ dump_stack_clash_frame_info (NO_PROBE_NO_FRAME, false);
+ return;
+ }
+
+ /* If we are a noreturn function, then we have to consider the
+ possibility that we're called via a jump rather than a call.
+
+ Thus we don't have the implicit probe generated by saving the
+ return address into the stack at the call. Thus, the stack
+ pointer could be anywhere in the guard page. The safe thing
+ to do is emit a probe now.
+
+ ?!? This should be revamped to work like aarch64 and s390 where
+ we track the offset from the most recent probe. Normally that
+ offset would be zero. For a non-return function we would reset
+ it to PROBE_INTERVAL - (STACK_BOUNDARY / BITS_PER_UNIT). Then
+ we just probe when we cross PROBE_INTERVAL. */
+ if (TREE_THIS_VOLATILE (cfun->decl))
+ {
+ emit_stack_probe (plus_constant (Pmode, stack_pointer_rtx,
+ -GET_MODE_SIZE (word_mode)));
+ emit_insn (gen_blockage ());
+ }
+
+ /* If we allocate less than the size of the guard statically,
+ then no probing is necessary, but we do need to allocate
+ the stack. */
+ if (size < (1 << PARAM_VALUE (PARAM_STACK_CLASH_PROTECTION_GUARD_SIZE)))
+ {
+ pro_epilogue_adjust_stack (stack_pointer_rtx, stack_pointer_rtx,
+ GEN_INT (-size), -1,
+ m->fs.cfa_reg == stack_pointer_rtx);
+ dump_stack_clash_frame_info (NO_PROBE_SMALL_FRAME, true);
+ return;
+ }
+
+ /* We're allocating a large enough stack frame that we need to
+ emit probes. Either emit them inline or in a loop depending
+ on the size. */
+ HOST_WIDE_INT probe_interval
+ = 1 << PARAM_VALUE (PARAM_STACK_CLASH_PROTECTION_PROBE_INTERVAL);
+ if (size <= 4 * probe_interval)
+ {
+ HOST_WIDE_INT i;
+ for (i = probe_interval; i <= size; i += probe_interval)
+ {
+ /* Allocate PROBE_INTERVAL bytes. */
+ pro_epilogue_adjust_stack (stack_pointer_rtx, stack_pointer_rtx,
+ GEN_INT (-probe_interval), -1,
+ m->fs.cfa_reg == stack_pointer_rtx);
+
+ /* And probe at *sp. */
+ emit_stack_probe (stack_pointer_rtx);
+ emit_insn (gen_blockage ());
+ }
+
+ /* We need to allocate space for the residual, but we do not need
+ to probe the residual. */
+ HOST_WIDE_INT residual = (i - probe_interval - size);
+ if (residual)
+ pro_epilogue_adjust_stack (stack_pointer_rtx, stack_pointer_rtx,
+ GEN_INT (residual), -1,
+ m->fs.cfa_reg == stack_pointer_rtx);
+ dump_stack_clash_frame_info (PROBE_INLINE, residual != 0);
+ }
+ else
+ {
+ struct scratch_reg sr;
+ get_scratch_register_on_entry (&sr);
+
+ /* Step 1: round SIZE down to a multiple of the interval. */
+ HOST_WIDE_INT rounded_size = size & -probe_interval;
+
+ /* Step 2: compute final value of the loop counter. Use lea if
+ possible. */
+ rtx addr = plus_constant (Pmode, stack_pointer_rtx, -rounded_size);
+ rtx insn;
+ if (address_operand (addr, Pmode))
+ insn = emit_insn (gen_rtx_SET (VOIDmode, sr.reg, addr));
+ else
+ {
+ emit_move_insn (sr.reg, GEN_INT (-rounded_size));
+ insn = emit_insn (gen_rtx_SET (VOIDmode, sr.reg,
+ gen_rtx_PLUS (Pmode, sr.reg,
+ stack_pointer_rtx)));
+ }
+ if (m->fs.cfa_reg == stack_pointer_rtx)
+ {
+ add_reg_note (insn, REG_CFA_DEF_CFA,
+ plus_constant (Pmode, sr.reg,
+ m->fs.cfa_offset + rounded_size));
+ RTX_FRAME_RELATED_P (insn) = 1;
+ }
+
+ /* Step 3: the loop. */
+ rtx size_rtx = GEN_INT (rounded_size);
+ insn = emit_insn (ix86_gen_adjust_stack_and_probe (sr.reg, sr.reg,
+ size_rtx));
+ if (m->fs.cfa_reg == stack_pointer_rtx)
+ {
+ m->fs.cfa_offset += rounded_size;
+ add_reg_note (insn, REG_CFA_DEF_CFA,
+ plus_constant (Pmode, stack_pointer_rtx,
+ m->fs.cfa_offset));
+ RTX_FRAME_RELATED_P (insn) = 1;
+ }
+ m->fs.sp_offset += rounded_size;
+ emit_insn (gen_blockage ());
+
+ /* Step 4: adjust SP if we cannot assert at compile-time that SIZE
+ is equal to ROUNDED_SIZE. */
+
+ if (size != rounded_size)
+ pro_epilogue_adjust_stack (stack_pointer_rtx, stack_pointer_rtx,
+ GEN_INT (rounded_size - size), -1,
+ m->fs.cfa_reg == stack_pointer_rtx);
+ dump_stack_clash_frame_info (PROBE_LOOP, size != rounded_size);
+
+ release_scratch_register_on_entry (&sr);
+ }
+
+ /* Make sure nothing is scheduled before we are done. */
+ emit_insn (gen_blockage ());
+}
+
/* Emit code to adjust the stack pointer by SIZE bytes while probing it. */
static void
@@ -10529,12 +10670,19 @@ ix86_expand_prologue (void)
/* The stack has already been decremented by the instruction calling us
so probe if the size is non-negative to preserve the protection area. */
- if (allocate >= 0 && flag_stack_check == STATIC_BUILTIN_STACK_CHECK)
+ if (allocate >= 0
+ && (flag_stack_check == STATIC_BUILTIN_STACK_CHECK
+ || flag_stack_clash_protection))
{
/* We expect the registers to be saved when probes are used. */
gcc_assert (int_registers_saved);
- if (STACK_CHECK_MOVING_SP)
+ if (flag_stack_clash_protection)
+ {
+ ix86_adjust_stack_and_probe_stack_clash (allocate);
+ allocate = 0;
+ }
+ else if (STACK_CHECK_MOVING_SP)
{
ix86_adjust_stack_and_probe (allocate);
allocate = 0;
diff --git a/gcc/testsuite/gcc.dg/stack-check-10.c b/gcc/testsuite/gcc.dg/stack-check-10.c
new file mode 100644
index 00000000000..a86956ad692
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/stack-check-10.c
@@ -0,0 +1,41 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fstack-clash-protection -fdump-rtl-pro_and_epilogue -fno-optimize-sibling-calls --param stack-clash-protection-probe-interval=12 --param stack-clash-protection-guard-size=12" } */
+/* { dg-require-effective-target supports_stack_clash_protection } */
+
+int f (int *);
+
+int
+g (int a)
+{
+ return f (&a);
+}
+
+int f1 (void);
+int f2 (int);
+
+int
+f3 (void)
+{
+ return f2 (f1 ());
+}
+
+
+/* If we have caller implicit probes, then we should not need probes in either callee.
+ Else callees may need probes, particularly if non-leaf functions require a
+ frame/frame pointer. */
+/* { dg-final { scan-rtl-dump-times "Stack clash no probe" 2 "pro_and_epilogue" { target caller_implicit_probes } } } */
+/* { dg-final { scan-rtl-dump-times "Stack clash inline probe" 1 "pro_and_epilogue" { target { ! caller_implicit_probes } } } } */
+/* { dg-final { scan-rtl-dump-times "Stack clash no probe" 1 "pro_and_epilogue" { target { ! caller_implicit_probes } } } } */
+
+/* Neither of these functions are a nonreturn function. */
+/* { dg-final { scan-rtl-dump-times "Stack clash not noreturn" 2 "pro_and_epilogue" } } */
+
+/* If the callee realigns the stack or has a mandatory frame, then both functions
+ have a residual allocation. Else just g() has a residual allocation. */
+/* { dg-final { scan-rtl-dump-times "Stack clash residual allocation in prologue" 2 "pro_and_epilogue" } } */
+
+
+/* If the target has frame pointers for non-leafs, then both functions will
+ need a frame pointer. Otherwise neither should. */
+/* { dg-final { scan-rtl-dump-times "Stack clash no frame pointer needed" 2 "pro_and_epilogue" { target { ! frame_pointer_for_non_leaf } } } } */
+/* { dg-final { scan-rtl-dump-times "Stack clash frame pointer needed" 2 "pro_and_epilogue" { target { frame_pointer_for_non_leaf } } } } */
diff --git a/gcc/testsuite/gcc.dg/stack-check-3.c b/gcc/testsuite/gcc.dg/stack-check-3.c
index 58fb65649ee..f0bf7c71a5b 100644
--- a/gcc/testsuite/gcc.dg/stack-check-3.c
+++ b/gcc/testsuite/gcc.dg/stack-check-3.c
@@ -7,7 +7,7 @@
residual allocation + probe for f?. */
/* { dg-do compile } */
-/* { dg-options "-O2 -fstack-clash-protection -fdump-rtl-expand -fno-optimize-sibling-calls --param stack-clash-protection-probe-interval=4096 --param stack-clash-protection-guard-size=4096" } */
+/* { dg-options "-O2 -fstack-clash-protection -fdump-rtl-expand -fno-optimize-sibling-calls --param stack-clash-protection-probe-interval=12 --param stack-clash-protection-guard-size=12" } */
/* { dg-require-effective-target supports_stack_clash_protection } */
__attribute__((noinline, noclone)) void
diff --git a/gcc/testsuite/gcc.dg/stack-check-4.c b/gcc/testsuite/gcc.dg/stack-check-4.c
new file mode 100644
index 00000000000..b0c5c61972f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/stack-check-4.c
@@ -0,0 +1,42 @@
+/* On targets where the call instruction is an implicit probe of *sp, we
+ elide stack probes as long as the size of the local stack is less than
+ PROBE_INTERVAL.
+
+ But if the caller were to transform a tail call into a direct jump
+ we do not have that implicit probe. This normally isn't a problem as
+ the caller must not have a local frame for that optimization to apply.
+
+ However, a sufficiently smart compiler could realize that the caller's
+ local stack need not be torn down and thus could transform a call into
+ a jump if the target is a noreturn function, even if the caller has
+ a local frame.
+
+ To guard against that, targets that depend on *sp being probed by the
+ call itself must emit a probe if the target function is a noreturn
+ function, even if they just allocate a small amount of stack space.
+
+ Rather than try to parse RTL or assembly code, we instead require the
+ prologue code to emit information into the dump file that we can
+ scan for. We scan for both the positive and negative cases. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fstack-clash-protection -fdump-rtl-pro_and_epilogue -fno-optimize-sibling-calls" } */
+/* { dg-require-effective-target supports_stack_clash_protection } */
+
+extern void arf (char *);
+
+__attribute__ ((noreturn)) void foo1 ()
+{
+ char x[10];
+ while (1)
+ arf (x);
+}
+
+void foo2 ()
+{
+ char x[10];
+ arf (x);
+}
+/* { dg-final { scan-rtl-dump-times "Stack clash noreturn" 1 "pro_and_epilogue" } } */
+/* { dg-final { scan-rtl-dump-times "Stack clash not noreturn" 1 "pro_and_epilogue" } } */
+
diff --git a/gcc/testsuite/gcc.dg/stack-check-5.c b/gcc/testsuite/gcc.dg/stack-check-5.c
new file mode 100644
index 00000000000..2171d9b6c23
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/stack-check-5.c
@@ -0,0 +1,74 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fstack-clash-protection -fdump-rtl-pro_and_epilogue -fno-optimize-sibling-calls --param stack-clash-protection-probe-interval=12 --param stack-clash-protection-guard-size=12" } */
+/* { dg-require-effective-target supports_stack_clash_protection } */
+
+
+extern void foo (char *);
+extern void bar (void);
+
+/* This function allocates no local stack and is a leaf. It should have no
+ probes on any target and should not require a frame pointer. */
+int
+f0 (int x, int y)
+{
+ asm volatile ("" : : : "memory");
+ return x + y;
+}
+
+/* This function allocates no local stack, but is not a leaf. Ideally it
+ should not need probing and no frame pointer. */
+int
+f1 (int x, int y)
+{
+ asm volatile ("" : : : "memory");
+ bar ();
+}
+
+/* This is a leaf with a small frame. On targets with implicit probes in
+ the caller, this should not need probing. On targets with no implicit
+ probes in the caller, it may require probes. Ideally it should need no
+ frame pointer. */
+void
+f2 (void)
+{
+ char buf[512];
+ asm volatile ("" : : "g" (&buf) : "memory");
+}
+
+/* This is a non-leaf with a small frame. On targets with implicit probes in
+ the caller, this should not need probing. On targets with no implicit
+ probes in the caller, it may require probes. It should need no frame
+ pointer. */
+void
+f3 (void)
+{
+ char buf[512];
+ foo (buf);
+}
+
+/* If we have caller implicit probes, then we should not need probes.
+ Else callees may need probes, particularly if non-leaf functions require a
+ frame/frame pointer. */
+/* { dg-final { scan-rtl-dump-times "Stack clash no probe" 4 "pro_and_epilogue" { target caller_implicit_probes } } } */
+/* { dg-final { scan-rtl-dump-times "Stack clash no probe" 2 "pro_and_epilogue" { target { ! caller_implicit_probes } } } } */
+/* { dg-final { scan-rtl-dump-times "Stack clash inline probes " 2 "pro_and_epilogue" { target { ! caller_implicit_probes } } } } */
+
+/* None of these functions are marked with the noreturn attribute. */
+/* { dg-final { scan-rtl-dump-times "Stack clash not noreturn" 4 "pro_and_epilogue" } } */
+
+/* Two functions are leafs, two are not. Verify the target identified them
+ appropriately. */
+/* { dg-final { scan-rtl-dump-times "Stack clash no frame pointer needed" 4 "pro_and_epilogue" { target { ! frame_pointer_for_non_leaf } } } } */
+/* { dg-final { scan-rtl-dump-times "Stack clash no frame pointer needed" 2 "pro_and_epilogue" { target { frame_pointer_for_non_leaf } } } } */
+/* { dg-final { scan-rtl-dump-times "Stack clash frame pointer needed" 2 "pro_and_epilogue" { target { frame_pointer_for_non_leaf } } } } */
+
+
+/* We have selected the size of the array in f2/f3 to be large enough
+ to not live in the red zone on targets that support it.
+
+ That allows simplification of this test considerably.
+ f1() should not require any allocations, thus no residuals.
+ All the rest of the functions require some kind of allocation,
+ either for the saved fp/rp or the array. */
+/* { dg-final { scan-rtl-dump-times "Stack clash no residual allocation in prologue" 1 "pro_and_epilogue" } } */
+/* { dg-final { scan-rtl-dump-times "Stack clash residual allocation in prologue" 3 "pro_and_epilogue" } } */
diff --git a/gcc/testsuite/gcc.dg/stack-check-6.c b/gcc/testsuite/gcc.dg/stack-check-6.c
new file mode 100644
index 00000000000..ad2021c9037
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/stack-check-6.c
@@ -0,0 +1,55 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fstack-clash-protection -fdump-rtl-pro_and_epilogue -fno-optimize-sibling-calls --param stack-clash-protection-probe-interval=12 --param stack-clash-protection-guard-size=12" } */
+/* { dg-require-effective-target supports_stack_clash_protection } */
+
+
+extern void foo (char *);
+extern void bar (void);
+
+
+/* This is a leaf with a frame that is large enough to require probing with
+ a residual allocation, but small enough to probe inline. */
+void
+f4 (void)
+{
+ char buf[4096 + 512];
+ asm volatile ("" : : "g" (&buf) : "memory");
+}
+
+
+/* This is a non-leaf with a frame large enough to require probing and
+ a residual allocation, but small enough to probe inline. */
+void
+f5 (void)
+{
+ char buf[4096 + 512];
+ foo (buf);
+}
+
+/* This is a leaf with a frame that is large enough to require probing with
+ a loop plus a residual allocation. */
+void
+f6 (void)
+{
+ char buf[4096 * 10 + 512];
+ asm volatile ("" : : "g" (&buf) : "memory");
+}
+
+
+/* This is a non-leaf with a frame large enough to require probing with
+ a loop plus a residual allocation. */
+void
+f7 (void)
+{
+ char buf[4096 * 10 + 512];
+ foo (buf);
+}
+
+/* { dg-final { scan-rtl-dump-times "Stack clash inline probes" 2 "pro_and_epilogue" } } */
+/* { dg-final { scan-rtl-dump-times "Stack clash probe loop" 2 "pro_and_epilogue" } } */
+/* { dg-final { scan-rtl-dump-times "Stack clash residual allocation in prologue" 4 "pro_and_epilogue" } } */
+/* { dg-final { scan-rtl-dump-times "Stack clash not noreturn" 4 "pro_and_epilogue" } } */
+
+/* { dg-final { scan-rtl-dump-times "Stack clash no frame pointer needed" 4 "pro_and_epilogue" { target { ! frame_pointer_for_non_leaf } } } } */
+/* { dg-final { scan-rtl-dump-times "Stack clash no frame pointer needed" 2 "pro_and_epilogue" { target { frame_pointer_for_non_leaf } } } } */
+/* { dg-final { scan-rtl-dump-times "Stack clash frame pointer needed" 2 "pro_and_epilogue" { target { frame_pointer_for_non_leaf } } } } */
diff --git a/gcc/testsuite/gcc.dg/stack-check-6a.c b/gcc/testsuite/gcc.dg/stack-check-6a.c
new file mode 100644
index 00000000000..6f8e7128921
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/stack-check-6a.c
@@ -0,0 +1,17 @@
+/* The goal here is to verify that increasing the size of the guard allows
+ elimination of all probing on the relevant targets. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fstack-clash-protection -fdump-rtl-pro_and_epilogue -fno-optimize-sibling-calls --param stack-clash-protection-probe-interval=12 --param stack-clash-protection-guard-size=16" } */
+/* { dg-require-effective-target supports_stack_clash_protection } */
+
+#include "stack-check-6.c"
+
+/* { dg-final { scan-rtl-dump-times "Stack clash inline probes" 0 "pro_and_epilogue" } } */
+/* { dg-final { scan-rtl-dump-times "Stack clash probe loop" 0 "pro_and_epilogue" } } */
+/* { dg-final { scan-rtl-dump-times "Stack clash residual allocation in prologue" 4 "pro_and_epilogue" } } */
+/* { dg-final { scan-rtl-dump-times "Stack clash not noreturn" 4 "pro_and_epilogue" } } */
+
+/* { dg-final { scan-rtl-dump-times "Stack clash no frame pointer needed" 4 "pro_and_epilogue" { target { ! frame_pointer_for_non_leaf } } } } */
+/* { dg-final { scan-rtl-dump-times "Stack clash no frame pointer needed" 2 "pro_and_epilogue" { target { frame_pointer_for_non_leaf } } } } */
+/* { dg-final { scan-rtl-dump-times "Stack clash frame pointer needed" 2 "pro_and_epilogue" { target { frame_pointer_for_non_leaf } } } } */
diff --git a/gcc/testsuite/gcc.dg/stack-check-7.c b/gcc/testsuite/gcc.dg/stack-check-7.c
new file mode 100644
index 00000000000..b963a2881dc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/stack-check-7.c
@@ -0,0 +1,36 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fstack-clash-protection -fno-optimize-sibling-calls --param stack-clash-protection-probe-interval=12 --param stack-clash-protection-guard-size=12" } */
+/* { dg-require-effective-target supports_stack_clash_protection } */
+
+/* For further testing, this can be run under valgrind where it's crashed
+ on aarch64 and ppc64le with -fstack-check=specific. */
+
+
+__attribute__((noinline, noclone)) void
+foo (char *p)
+{
+ asm volatile ("" : : "r" (p) : "memory");
+}
+
+__attribute__((noinline, noclone)) void
+bar (void)
+{
+ char buf[131072];
+ foo (buf);
+}
+
+__attribute__((noinline, noclone)) void
+baz (void)
+{
+ char buf[12000];
+ foo (buf);
+}
+
+int
+main ()
+{
+ bar ();
+ baz ();
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/stack-check-8.c b/gcc/testsuite/gcc.dg/stack-check-8.c
new file mode 100644
index 00000000000..0ccec8b532a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/stack-check-8.c
@@ -0,0 +1,139 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -w -fstack-clash-protection -Wno-psabi -fno-optimize-sibling-calls --param stack-clash-protection-probe-interval=12 --param stack-clash-protection-guard-size=12" } */
+/* { dg-require-effective-target supports_stack_clash_protection } */
+
+
+typedef float V __attribute__((vector_size (32)));
+
+__attribute__((noinline, noclone)) void
+foo (char *p)
+{
+ asm volatile ("" : : "r" (p) : "memory");
+}
+
+__attribute__((noinline, noclone)) int
+f0 (int x, int y)
+{
+ asm volatile ("" : : : "memory");
+ return x + y;
+}
+
+__attribute__((noinline, noclone)) void
+f1 (void)
+{
+ char buf[64];
+ foo (buf);
+}
+
+__attribute__((noinline, noclone)) void
+f2 (void)
+{
+ char buf[12000];
+ foo (buf);
+}
+
+__attribute__((noinline, noclone)) void
+f3 (void)
+{
+ char buf[131072];
+ foo (buf);
+}
+
+__attribute__((noinline, noclone)) void
+f4 (int x)
+{
+ char vla[x];
+ foo (vla);
+}
+
+__attribute__((noinline, noclone)) void
+f5 (int x)
+{
+ char buf[12000];
+ foo (buf);
+ {
+ char vla[x];
+ foo (vla);
+ }
+ {
+ char vla[x];
+ foo (vla);
+ }
+}
+
+V v;
+
+__attribute__((noinline, noclone)) int
+f6 (int x, int y, V a, V b, V c)
+{
+ asm volatile ("" : : : "memory");
+ v = a + b + c;
+ return x + y;
+}
+
+__attribute__((noinline, noclone)) void
+f7 (V a, V b, V c)
+{
+ char buf[64];
+ foo (buf);
+ v = a + b + c;
+}
+
+__attribute__((noinline, noclone)) void
+f8 (V a, V b, V c)
+{
+ char buf[12000];
+ foo (buf);
+ v = a + b + c;
+}
+
+__attribute__((noinline, noclone)) void
+f9 (V a, V b, V c)
+{
+ char buf[131072];
+ foo (buf);
+ v = a + b + c;
+}
+
+__attribute__((noinline, noclone)) void
+f10 (int x, V a, V b, V c)
+{
+ char vla[x];
+ foo (vla);
+ v = a + b + c;
+}
+
+__attribute__((noinline, noclone)) void
+f11 (int x, V a, V b, V c)
+{
+ char buf[12000];
+ foo (buf);
+ v = a + b + c;
+ {
+ char vla[x];
+ foo (vla);
+ }
+ {
+ char vla[x];
+ foo (vla);
+ }
+}
+
+int
+main ()
+{
+ f0 (2, 3);
+ f1 ();
+ f2 ();
+ f3 ();
+ f4 (12000);
+ f5 (12000);
+ f6 (2, 3, v, v, v);
+ f7 (v, v, v);
+ f8 (v, v, v);
+ f9 (v, v, v);
+ f10 (12000, v, v, v);
+ f11 (12000, v, v, v);
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/stack-check-9.c b/gcc/testsuite/gcc.dg/stack-check-9.c
new file mode 100644
index 00000000000..b84075b9b43
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/stack-check-9.c
@@ -0,0 +1,2022 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fstack-clash-protection -fdump-rtl-pro_and_epilogue -fno-optimize-sibling-calls --param stack-clash-protection-probe-interval=12 --param stack-clash-protection-guard-size=12" } */
+/* { dg-require-effective-target supports_stack_clash_protection } */
+
+double f1 (void);
+double f2 (double, double);
+
+double
+f3 (void)
+{
+ double d000 = f1 ();
+ double d001 = f1 ();
+ double d002 = f1 ();
+ double d003 = f1 ();
+ double d004 = f1 ();
+ double d005 = f1 ();
+ double d006 = f1 ();
+ double d007 = f1 ();
+ double d008 = f1 ();
+ double d009 = f1 ();
+ double d010 = f1 ();
+ double d011 = f1 ();
+ double d012 = f1 ();
+ double d013 = f1 ();
+ double d014 = f1 ();
+ double d015 = f1 ();
+ double d016 = f1 ();
+ double d017 = f1 ();
+ double d018 = f1 ();
+ double d019 = f1 ();
+ double d020 = f1 ();
+ double d021 = f1 ();
+ double d022 = f1 ();
+ double d023 = f1 ();
+ double d024 = f1 ();
+ double d025 = f1 ();
+ double d026 = f1 ();
+ double d027 = f1 ();
+ double d028 = f1 ();
+ double d029 = f1 ();
+ double d030 = f1 ();
+ double d031 = f1 ();
+ double d032 = f1 ();
+ double d033 = f1 ();
+ double d034 = f1 ();
+ double d035 = f1 ();
+ double d036 = f1 ();
+ double d037 = f1 ();
+ double d038 = f1 ();
+ double d039 = f1 ();
+ double d040 = f1 ();
+ double d041 = f1 ();
+ double d042 = f1 ();
+ double d043 = f1 ();
+ double d044 = f1 ();
+ double d045 = f1 ();
+ double d046 = f1 ();
+ double d047 = f1 ();
+ double d048 = f1 ();
+ double d049 = f1 ();
+ double d050 = f1 ();
+ double d051 = f1 ();
+ double d052 = f1 ();
+ double d053 = f1 ();
+ double d054 = f1 ();
+ double d055 = f1 ();
+ double d056 = f1 ();
+ double d057 = f1 ();
+ double d058 = f1 ();
+ double d059 = f1 ();
+ double d060 = f1 ();
+ double d061 = f1 ();
+ double d062 = f1 ();
+ double d063 = f1 ();
+ double d064 = f1 ();
+ double d065 = f1 ();
+ double d066 = f1 ();
+ double d067 = f1 ();
+ double d068 = f1 ();
+ double d069 = f1 ();
+ double d070 = f1 ();
+ double d071 = f1 ();
+ double d072 = f1 ();
+ double d073 = f1 ();
+ double d074 = f1 ();
+ double d075 = f1 ();
+ double d076 = f1 ();
+ double d077 = f1 ();
+ double d078 = f1 ();
+ double d079 = f1 ();
+ double d080 = f1 ();
+ double d081 = f1 ();
+ double d082 = f1 ();
+ double d083 = f1 ();
+ double d084 = f1 ();
+ double d085 = f1 ();
+ double d086 = f1 ();
+ double d087 = f1 ();
+ double d088 = f1 ();
+ double d089 = f1 ();
+ double d090 = f1 ();
+ double d091 = f1 ();
+ double d092 = f1 ();
+ double d093 = f1 ();
+ double d094 = f1 ();
+ double d095 = f1 ();
+ double d096 = f1 ();
+ double d097 = f1 ();
+ double d098 = f1 ();
+ double d099 = f1 ();
+ double d100 = f1 ();
+ double d101 = f1 ();
+ double d102 = f1 ();
+ double d103 = f1 ();
+ double d104 = f1 ();
+ double d105 = f1 ();
+ double d106 = f1 ();
+ double d107 = f1 ();
+ double d108 = f1 ();
+ double d109 = f1 ();
+ double d110 = f1 ();
+ double d111 = f1 ();
+ double d112 = f1 ();
+ double d113 = f1 ();
+ double d114 = f1 ();
+ double d115 = f1 ();
+ double d116 = f1 ();
+ double d117 = f1 ();
+ double d118 = f1 ();
+ double d119 = f1 ();
+ double d120 = f1 ();
+ double d121 = f1 ();
+ double d122 = f1 ();
+ double d123 = f1 ();
+ double d124 = f1 ();
+ double d125 = f1 ();
+ double d126 = f1 ();
+ double d127 = f1 ();
+ double d128 = f1 ();
+ double d129 = f1 ();
+ double d130 = f1 ();
+ double d131 = f1 ();
+ double d132 = f1 ();
+ double d133 = f1 ();
+ double d134 = f1 ();
+ double d135 = f1 ();
+ double d136 = f1 ();
+ double d137 = f1 ();
+ double d138 = f1 ();
+ double d139 = f1 ();
+ double d140 = f1 ();
+ double d141 = f1 ();
+ double d142 = f1 ();
+ double d143 = f1 ();
+ double d144 = f1 ();
+ double d145 = f1 ();
+ double d146 = f1 ();
+ double d147 = f1 ();
+ double d148 = f1 ();
+ double d149 = f1 ();
+ double d150 = f1 ();
+ double d151 = f1 ();
+ double d152 = f1 ();
+ double d153 = f1 ();
+ double d154 = f1 ();
+ double d155 = f1 ();
+ double d156 = f1 ();
+ double d157 = f1 ();
+ double d158 = f1 ();
+ double d159 = f1 ();
+ double d160 = f1 ();
+ double d161 = f1 ();
+ double d162 = f1 ();
+ double d163 = f1 ();
+ double d164 = f1 ();
+ double d165 = f1 ();
+ double d166 = f1 ();
+ double d167 = f1 ();
+ double d168 = f1 ();
+ double d169 = f1 ();
+ double d170 = f1 ();
+ double d171 = f1 ();
+ double d172 = f1 ();
+ double d173 = f1 ();
+ double d174 = f1 ();
+ double d175 = f1 ();
+ double d176 = f1 ();
+ double d177 = f1 ();
+ double d178 = f1 ();
+ double d179 = f1 ();
+ double d180 = f1 ();
+ double d181 = f1 ();
+ double d182 = f1 ();
+ double d183 = f1 ();
+ double d184 = f1 ();
+ double d185 = f1 ();
+ double d186 = f1 ();
+ double d187 = f1 ();
+ double d188 = f1 ();
+ double d189 = f1 ();
+ double d190 = f1 ();
+ double d191 = f1 ();
+ double d192 = f1 ();
+ double d193 = f1 ();
+ double d194 = f1 ();
+ double d195 = f1 ();
+ double d196 = f1 ();
+ double d197 = f1 ();
+ double d198 = f1 ();
+ double d199 = f1 ();
+ double d200 = f1 ();
+ double d201 = f1 ();
+ double d202 = f1 ();
+ double d203 = f1 ();
+ double d204 = f1 ();
+ double d205 = f1 ();
+ double d206 = f1 ();
+ double d207 = f1 ();
+ double d208 = f1 ();
+ double d209 = f1 ();
+ double d210 = f1 ();
+ double d211 = f1 ();
+ double d212 = f1 ();
+ double d213 = f1 ();
+ double d214 = f1 ();
+ double d215 = f1 ();
+ double d216 = f1 ();
+ double d217 = f1 ();
+ double d218 = f1 ();
+ double d219 = f1 ();
+ double d220 = f1 ();
+ double d221 = f1 ();
+ double d222 = f1 ();
+ double d223 = f1 ();
+ double d224 = f1 ();
+ double d225 = f1 ();
+ double d226 = f1 ();
+ double d227 = f1 ();
+ double d228 = f1 ();
+ double d229 = f1 ();
+ double d230 = f1 ();
+ double d231 = f1 ();
+ double d232 = f1 ();
+ double d233 = f1 ();
+ double d234 = f1 ();
+ double d235 = f1 ();
+ double d236 = f1 ();
+ double d237 = f1 ();
+ double d238 = f1 ();
+ double d239 = f1 ();
+ double d240 = f1 ();
+ double d241 = f1 ();
+ double d242 = f1 ();
+ double d243 = f1 ();
+ double d244 = f1 ();
+ double d245 = f1 ();
+ double d246 = f1 ();
+ double d247 = f1 ();
+ double d248 = f1 ();
+ double d249 = f1 ();
+ double d250 = f1 ();
+ double d251 = f1 ();
+ double d252 = f1 ();
+ double d253 = f1 ();
+ double d254 = f1 ();
+ double d255 = f1 ();
+ double d256 = f1 ();
+ double d257 = f1 ();
+ double d258 = f1 ();
+ double d259 = f1 ();
+ double d260 = f1 ();
+ double d261 = f1 ();
+ double d262 = f1 ();
+ double d263 = f1 ();
+ double d264 = f1 ();
+ double d265 = f1 ();
+ double d266 = f1 ();
+ double d267 = f1 ();
+ double d268 = f1 ();
+ double d269 = f1 ();
+ double d270 = f1 ();
+ double d271 = f1 ();
+ double d272 = f1 ();
+ double d273 = f1 ();
+ double d274 = f1 ();
+ double d275 = f1 ();
+ double d276 = f1 ();
+ double d277 = f1 ();
+ double d278 = f1 ();
+ double d279 = f1 ();
+ double d280 = f1 ();
+ double d281 = f1 ();
+ double d282 = f1 ();
+ double d283 = f1 ();
+ double d284 = f1 ();
+ double d285 = f1 ();
+ double d286 = f1 ();
+ double d287 = f1 ();
+ double d288 = f1 ();
+ double d289 = f1 ();
+ double d290 = f1 ();
+ double d291 = f1 ();
+ double d292 = f1 ();
+ double d293 = f1 ();
+ double d294 = f1 ();
+ double d295 = f1 ();
+ double d296 = f1 ();
+ double d297 = f1 ();
+ double d298 = f1 ();
+ double d299 = f1 ();
+ double d300 = f1 ();
+ double d301 = f1 ();
+ double d302 = f1 ();
+ double d303 = f1 ();
+ double d304 = f1 ();
+ double d305 = f1 ();
+ double d306 = f1 ();
+ double d307 = f1 ();
+ double d308 = f1 ();
+ double d309 = f1 ();
+ double d310 = f1 ();
+ double d311 = f1 ();
+ double d312 = f1 ();
+ double d313 = f1 ();
+ double d314 = f1 ();
+ double d315 = f1 ();
+ double d316 = f1 ();
+ double d317 = f1 ();
+ double d318 = f1 ();
+ double d319 = f1 ();
+ double d320 = f1 ();
+ double d321 = f1 ();
+ double d322 = f1 ();
+ double d323 = f1 ();
+ double d324 = f1 ();
+ double d325 = f1 ();
+ double d326 = f1 ();
+ double d327 = f1 ();
+ double d328 = f1 ();
+ double d329 = f1 ();
+ double d330 = f1 ();
+ double d331 = f1 ();
+ double d332 = f1 ();
+ double d333 = f1 ();
+ double d334 = f1 ();
+ double d335 = f1 ();
+ double d336 = f1 ();
+ double d337 = f1 ();
+ double d338 = f1 ();
+ double d339 = f1 ();
+ double d340 = f1 ();
+ double d341 = f1 ();
+ double d342 = f1 ();
+ double d343 = f1 ();
+ double d344 = f1 ();
+ double d345 = f1 ();
+ double d346 = f1 ();
+ double d347 = f1 ();
+ double d348 = f1 ();
+ double d349 = f1 ();
+ double d350 = f1 ();
+ double d351 = f1 ();
+ double d352 = f1 ();
+ double d353 = f1 ();
+ double d354 = f1 ();
+ double d355 = f1 ();
+ double d356 = f1 ();
+ double d357 = f1 ();
+ double d358 = f1 ();
+ double d359 = f1 ();
+ double d360 = f1 ();
+ double d361 = f1 ();
+ double d362 = f1 ();
+ double d363 = f1 ();
+ double d364 = f1 ();
+ double d365 = f1 ();
+ double d366 = f1 ();
+ double d367 = f1 ();
+ double d368 = f1 ();
+ double d369 = f1 ();
+ double d370 = f1 ();
+ double d371 = f1 ();
+ double d372 = f1 ();
+ double d373 = f1 ();
+ double d374 = f1 ();
+ double d375 = f1 ();
+ double d376 = f1 ();
+ double d377 = f1 ();
+ double d378 = f1 ();
+ double d379 = f1 ();
+ double d380 = f1 ();
+ double d381 = f1 ();
+ double d382 = f1 ();
+ double d383 = f1 ();
+ double d384 = f1 ();
+ double d385 = f1 ();
+ double d386 = f1 ();
+ double d387 = f1 ();
+ double d388 = f1 ();
+ double d389 = f1 ();
+ double d390 = f1 ();
+ double d391 = f1 ();
+ double d392 = f1 ();
+ double d393 = f1 ();
+ double d394 = f1 ();
+ double d395 = f1 ();
+ double d396 = f1 ();
+ double d397 = f1 ();
+ double d398 = f1 ();
+ double d399 = f1 ();
+ double d400 = f1 ();
+ double d401 = f1 ();
+ double d402 = f1 ();
+ double d403 = f1 ();
+ double d404 = f1 ();
+ double d405 = f1 ();
+ double d406 = f1 ();
+ double d407 = f1 ();
+ double d408 = f1 ();
+ double d409 = f1 ();
+ double d410 = f1 ();
+ double d411 = f1 ();
+ double d412 = f1 ();
+ double d413 = f1 ();
+ double d414 = f1 ();
+ double d415 = f1 ();
+ double d416 = f1 ();
+ double d417 = f1 ();
+ double d418 = f1 ();
+ double d419 = f1 ();
+ double d420 = f1 ();
+ double d421 = f1 ();
+ double d422 = f1 ();
+ double d423 = f1 ();
+ double d424 = f1 ();
+ double d425 = f1 ();
+ double d426 = f1 ();
+ double d427 = f1 ();
+ double d428 = f1 ();
+ double d429 = f1 ();
+ double d430 = f1 ();
+ double d431 = f1 ();
+ double d432 = f1 ();
+ double d433 = f1 ();
+ double d434 = f1 ();
+ double d435 = f1 ();
+ double d436 = f1 ();
+ double d437 = f1 ();
+ double d438 = f1 ();
+ double d439 = f1 ();
+ double d440 = f1 ();
+ double d441 = f1 ();
+ double d442 = f1 ();
+ double d443 = f1 ();
+ double d444 = f1 ();
+ double d445 = f1 ();
+ double d446 = f1 ();
+ double d447 = f1 ();
+ double d448 = f1 ();
+ double d449 = f1 ();
+ double d450 = f1 ();
+ double d451 = f1 ();
+ double d452 = f1 ();
+ double d453 = f1 ();
+ double d454 = f1 ();
+ double d455 = f1 ();
+ double d456 = f1 ();
+ double d457 = f1 ();
+ double d458 = f1 ();
+ double d459 = f1 ();
+ double d460 = f1 ();
+ double d461 = f1 ();
+ double d462 = f1 ();
+ double d463 = f1 ();
+ double d464 = f1 ();
+ double d465 = f1 ();
+ double d466 = f1 ();
+ double d467 = f1 ();
+ double d468 = f1 ();
+ double d469 = f1 ();
+ double d470 = f1 ();
+ double d471 = f1 ();
+ double d472 = f1 ();
+ double d473 = f1 ();
+ double d474 = f1 ();
+ double d475 = f1 ();
+ double d476 = f1 ();
+ double d477 = f1 ();
+ double d478 = f1 ();
+ double d479 = f1 ();
+ double d480 = f1 ();
+ double d481 = f1 ();
+ double d482 = f1 ();
+ double d483 = f1 ();
+ double d484 = f1 ();
+ double d485 = f1 ();
+ double d486 = f1 ();
+ double d487 = f1 ();
+ double d488 = f1 ();
+ double d489 = f1 ();
+ double d490 = f1 ();
+ double d491 = f1 ();
+ double d492 = f1 ();
+ double d493 = f1 ();
+ double d494 = f1 ();
+ double d495 = f1 ();
+ double d496 = f1 ();
+ double d497 = f1 ();
+ double d498 = f1 ();
+ double d499 = f1 ();
+ double d500 = f1 ();
+ double d501 = f1 ();
+ double d502 = f1 ();
+ double d503 = f1 ();
+ double d504 = f1 ();
+ double d505 = f1 ();
+ double d506 = f1 ();
+ double d507 = f1 ();
+ double d508 = f1 ();
+ double d509 = f1 ();
+ double d510 = f1 ();
+ double d511 = f1 ();
+ double d512 = f1 ();
+ double d513 = f1 ();
+ double d514 = f1 ();
+ double d515 = f1 ();
+ double d516 = f1 ();
+ double d517 = f1 ();
+ double d518 = f1 ();
+ double d519 = f1 ();
+ double d520 = f1 ();
+ double d521 = f1 ();
+ double d522 = f1 ();
+ double d523 = f1 ();
+ double d524 = f1 ();
+ double d525 = f1 ();
+ double d526 = f1 ();
+ double d527 = f1 ();
+ double d528 = f1 ();
+ double d529 = f1 ();
+ double d530 = f1 ();
+ double d531 = f1 ();
+ double d532 = f1 ();
+ double d533 = f1 ();
+ double d534 = f1 ();
+ double d535 = f1 ();
+ double d536 = f1 ();
+ double d537 = f1 ();
+ double d538 = f1 ();
+ double d539 = f1 ();
+ double d540 = f1 ();
+ double d541 = f1 ();
+ double d542 = f1 ();
+ double d543 = f1 ();
+ double d544 = f1 ();
+ double d545 = f1 ();
+ double d546 = f1 ();
+ double d547 = f1 ();
+ double d548 = f1 ();
+ double d549 = f1 ();
+ double d550 = f1 ();
+ double d551 = f1 ();
+ double d552 = f1 ();
+ double d553 = f1 ();
+ double d554 = f1 ();
+ double d555 = f1 ();
+ double d556 = f1 ();
+ double d557 = f1 ();
+ double d558 = f1 ();
+ double d559 = f1 ();
+ double d560 = f1 ();
+ double d561 = f1 ();
+ double d562 = f1 ();
+ double d563 = f1 ();
+ double d564 = f1 ();
+ double d565 = f1 ();
+ double d566 = f1 ();
+ double d567 = f1 ();
+ double d568 = f1 ();
+ double d569 = f1 ();
+ double d570 = f1 ();
+ double d571 = f1 ();
+ double d572 = f1 ();
+ double d573 = f1 ();
+ double d574 = f1 ();
+ double d575 = f1 ();
+ double d576 = f1 ();
+ double d577 = f1 ();
+ double d578 = f1 ();
+ double d579 = f1 ();
+ double d580 = f1 ();
+ double d581 = f1 ();
+ double d582 = f1 ();
+ double d583 = f1 ();
+ double d584 = f1 ();
+ double d585 = f1 ();
+ double d586 = f1 ();
+ double d587 = f1 ();
+ double d588 = f1 ();
+ double d589 = f1 ();
+ double d590 = f1 ();
+ double d591 = f1 ();
+ double d592 = f1 ();
+ double d593 = f1 ();
+ double d594 = f1 ();
+ double d595 = f1 ();
+ double d596 = f1 ();
+ double d597 = f1 ();
+ double d598 = f1 ();
+ double d599 = f1 ();
+ double d600 = f1 ();
+ double d601 = f1 ();
+ double d602 = f1 ();
+ double d603 = f1 ();
+ double d604 = f1 ();
+ double d605 = f1 ();
+ double d606 = f1 ();
+ double d607 = f1 ();
+ double d608 = f1 ();
+ double d609 = f1 ();
+ double d610 = f1 ();
+ double d611 = f1 ();
+ double d612 = f1 ();
+ double d613 = f1 ();
+ double d614 = f1 ();
+ double d615 = f1 ();
+ double d616 = f1 ();
+ double d617 = f1 ();
+ double d618 = f1 ();
+ double d619 = f1 ();
+ double d620 = f1 ();
+ double d621 = f1 ();
+ double d622 = f1 ();
+ double d623 = f1 ();
+ double d624 = f1 ();
+ double d625 = f1 ();
+ double d626 = f1 ();
+ double d627 = f1 ();
+ double d628 = f1 ();
+ double d629 = f1 ();
+ double d630 = f1 ();
+ double d631 = f1 ();
+ double d632 = f1 ();
+ double d633 = f1 ();
+ double d634 = f1 ();
+ double d635 = f1 ();
+ double d636 = f1 ();
+ double d637 = f1 ();
+ double d638 = f1 ();
+ double d639 = f1 ();
+ double d640 = f1 ();
+ double d641 = f1 ();
+ double d642 = f1 ();
+ double d643 = f1 ();
+ double d644 = f1 ();
+ double d645 = f1 ();
+ double d646 = f1 ();
+ double d647 = f1 ();
+ double d648 = f1 ();
+ double d649 = f1 ();
+ double d650 = f1 ();
+ double d651 = f1 ();
+ double d652 = f1 ();
+ double d653 = f1 ();
+ double d654 = f1 ();
+ double d655 = f1 ();
+ double d656 = f1 ();
+ double d657 = f1 ();
+ double d658 = f1 ();
+ double d659 = f1 ();
+ double d660 = f1 ();
+ double d661 = f1 ();
+ double d662 = f1 ();
+ double d663 = f1 ();
+ double d664 = f1 ();
+ double d665 = f1 ();
+ double d666 = f1 ();
+ double d667 = f1 ();
+ double d668 = f1 ();
+ double d669 = f1 ();
+ double d670 = f1 ();
+ double d671 = f1 ();
+ double d672 = f1 ();
+ double d673 = f1 ();
+ double d674 = f1 ();
+ double d675 = f1 ();
+ double d676 = f1 ();
+ double d677 = f1 ();
+ double d678 = f1 ();
+ double d679 = f1 ();
+ double d680 = f1 ();
+ double d681 = f1 ();
+ double d682 = f1 ();
+ double d683 = f1 ();
+ double d684 = f1 ();
+ double d685 = f1 ();
+ double d686 = f1 ();
+ double d687 = f1 ();
+ double d688 = f1 ();
+ double d689 = f1 ();
+ double d690 = f1 ();
+ double d691 = f1 ();
+ double d692 = f1 ();
+ double d693 = f1 ();
+ double d694 = f1 ();
+ double d695 = f1 ();
+ double d696 = f1 ();
+ double d697 = f1 ();
+ double d698 = f1 ();
+ double d699 = f1 ();
+ double d700 = f1 ();
+ double d701 = f1 ();
+ double d702 = f1 ();
+ double d703 = f1 ();
+ double d704 = f1 ();
+ double d705 = f1 ();
+ double d706 = f1 ();
+ double d707 = f1 ();
+ double d708 = f1 ();
+ double d709 = f1 ();
+ double d710 = f1 ();
+ double d711 = f1 ();
+ double d712 = f1 ();
+ double d713 = f1 ();
+ double d714 = f1 ();
+ double d715 = f1 ();
+ double d716 = f1 ();
+ double d717 = f1 ();
+ double d718 = f1 ();
+ double d719 = f1 ();
+ double d720 = f1 ();
+ double d721 = f1 ();
+ double d722 = f1 ();
+ double d723 = f1 ();
+ double d724 = f1 ();
+ double d725 = f1 ();
+ double d726 = f1 ();
+ double d727 = f1 ();
+ double d728 = f1 ();
+ double d729 = f1 ();
+ double d730 = f1 ();
+ double d731 = f1 ();
+ double d732 = f1 ();
+ double d733 = f1 ();
+ double d734 = f1 ();
+ double d735 = f1 ();
+ double d736 = f1 ();
+ double d737 = f1 ();
+ double d738 = f1 ();
+ double d739 = f1 ();
+ double d740 = f1 ();
+ double d741 = f1 ();
+ double d742 = f1 ();
+ double d743 = f1 ();
+ double d744 = f1 ();
+ double d745 = f1 ();
+ double d746 = f1 ();
+ double d747 = f1 ();
+ double d748 = f1 ();
+ double d749 = f1 ();
+ double d750 = f1 ();
+ double d751 = f1 ();
+ double d752 = f1 ();
+ double d753 = f1 ();
+ double d754 = f1 ();
+ double d755 = f1 ();
+ double d756 = f1 ();
+ double d757 = f1 ();
+ double d758 = f1 ();
+ double d759 = f1 ();
+ double d760 = f1 ();
+ double d761 = f1 ();
+ double d762 = f1 ();
+ double d763 = f1 ();
+ double d764 = f1 ();
+ double d765 = f1 ();
+ double d766 = f1 ();
+ double d767 = f1 ();
+ double d768 = f1 ();
+ double d769 = f1 ();
+ double d770 = f1 ();
+ double d771 = f1 ();
+ double d772 = f1 ();
+ double d773 = f1 ();
+ double d774 = f1 ();
+ double d775 = f1 ();
+ double d776 = f1 ();
+ double d777 = f1 ();
+ double d778 = f1 ();
+ double d779 = f1 ();
+ double d780 = f1 ();
+ double d781 = f1 ();
+ double d782 = f1 ();
+ double d783 = f1 ();
+ double d784 = f1 ();
+ double d785 = f1 ();
+ double d786 = f1 ();
+ double d787 = f1 ();
+ double d788 = f1 ();
+ double d789 = f1 ();
+ double d790 = f1 ();
+ double d791 = f1 ();
+ double d792 = f1 ();
+ double d793 = f1 ();
+ double d794 = f1 ();
+ double d795 = f1 ();
+ double d796 = f1 ();
+ double d797 = f1 ();
+ double d798 = f1 ();
+ double d799 = f1 ();
+ double d800 = f1 ();
+ double d801 = f1 ();
+ double d802 = f1 ();
+ double d803 = f1 ();
+ double d804 = f1 ();
+ double d805 = f1 ();
+ double d806 = f1 ();
+ double d807 = f1 ();
+ double d808 = f1 ();
+ double d809 = f1 ();
+ double d810 = f1 ();
+ double d811 = f1 ();
+ double d812 = f1 ();
+ double d813 = f1 ();
+ double d814 = f1 ();
+ double d815 = f1 ();
+ double d816 = f1 ();
+ double d817 = f1 ();
+ double d818 = f1 ();
+ double d819 = f1 ();
+ double d820 = f1 ();
+ double d821 = f1 ();
+ double d822 = f1 ();
+ double d823 = f1 ();
+ double d824 = f1 ();
+ double d825 = f1 ();
+ double d826 = f1 ();
+ double d827 = f1 ();
+ double d828 = f1 ();
+ double d829 = f1 ();
+ double d830 = f1 ();
+ double d831 = f1 ();
+ double d832 = f1 ();
+ double d833 = f1 ();
+ double d834 = f1 ();
+ double d835 = f1 ();
+ double d836 = f1 ();
+ double d837 = f1 ();
+ double d838 = f1 ();
+ double d839 = f1 ();
+ double d840 = f1 ();
+ double d841 = f1 ();
+ double d842 = f1 ();
+ double d843 = f1 ();
+ double d844 = f1 ();
+ double d845 = f1 ();
+ double d846 = f1 ();
+ double d847 = f1 ();
+ double d848 = f1 ();
+ double d849 = f1 ();
+ double d850 = f1 ();
+ double d851 = f1 ();
+ double d852 = f1 ();
+ double d853 = f1 ();
+ double d854 = f1 ();
+ double d855 = f1 ();
+ double d856 = f1 ();
+ double d857 = f1 ();
+ double d858 = f1 ();
+ double d859 = f1 ();
+ double d860 = f1 ();
+ double d861 = f1 ();
+ double d862 = f1 ();
+ double d863 = f1 ();
+ double d864 = f1 ();
+ double d865 = f1 ();
+ double d866 = f1 ();
+ double d867 = f1 ();
+ double d868 = f1 ();
+ double d869 = f1 ();
+ double d870 = f1 ();
+ double d871 = f1 ();
+ double d872 = f1 ();
+ double d873 = f1 ();
+ double d874 = f1 ();
+ double d875 = f1 ();
+ double d876 = f1 ();
+ double d877 = f1 ();
+ double d878 = f1 ();
+ double d879 = f1 ();
+ double d880 = f1 ();
+ double d881 = f1 ();
+ double d882 = f1 ();
+ double d883 = f1 ();
+ double d884 = f1 ();
+ double d885 = f1 ();
+ double d886 = f1 ();
+ double d887 = f1 ();
+ double d888 = f1 ();
+ double d889 = f1 ();
+ double d890 = f1 ();
+ double d891 = f1 ();
+ double d892 = f1 ();
+ double d893 = f1 ();
+ double d894 = f1 ();
+ double d895 = f1 ();
+ double d896 = f1 ();
+ double d897 = f1 ();
+ double d898 = f1 ();
+ double d899 = f1 ();
+ double d900 = f1 ();
+ double d901 = f1 ();
+ double d902 = f1 ();
+ double d903 = f1 ();
+ double d904 = f1 ();
+ double d905 = f1 ();
+ double d906 = f1 ();
+ double d907 = f1 ();
+ double d908 = f1 ();
+ double d909 = f1 ();
+ double d910 = f1 ();
+ double d911 = f1 ();
+ double d912 = f1 ();
+ double d913 = f1 ();
+ double d914 = f1 ();
+ double d915 = f1 ();
+ double d916 = f1 ();
+ double d917 = f1 ();
+ double d918 = f1 ();
+ double d919 = f1 ();
+ double d920 = f1 ();
+ double d921 = f1 ();
+ double d922 = f1 ();
+ double d923 = f1 ();
+ double d924 = f1 ();
+ double d925 = f1 ();
+ double d926 = f1 ();
+ double d927 = f1 ();
+ double d928 = f1 ();
+ double d929 = f1 ();
+ double d930 = f1 ();
+ double d931 = f1 ();
+ double d932 = f1 ();
+ double d933 = f1 ();
+ double d934 = f1 ();
+ double d935 = f1 ();
+ double d936 = f1 ();
+ double d937 = f1 ();
+ double d938 = f1 ();
+ double d939 = f1 ();
+ double d940 = f1 ();
+ double d941 = f1 ();
+ double d942 = f1 ();
+ double d943 = f1 ();
+ double d944 = f1 ();
+ double d945 = f1 ();
+ double d946 = f1 ();
+ double d947 = f1 ();
+ double d948 = f1 ();
+ double d949 = f1 ();
+ double d950 = f1 ();
+ double d951 = f1 ();
+ double d952 = f1 ();
+ double d953 = f1 ();
+ double d954 = f1 ();
+ double d955 = f1 ();
+ double d956 = f1 ();
+ double d957 = f1 ();
+ double d958 = f1 ();
+ double d959 = f1 ();
+ double d960 = f1 ();
+ double d961 = f1 ();
+ double d962 = f1 ();
+ double d963 = f1 ();
+ double d964 = f1 ();
+ double d965 = f1 ();
+ double d966 = f1 ();
+ double d967 = f1 ();
+ double d968 = f1 ();
+ double d969 = f1 ();
+ double d970 = f1 ();
+ double d971 = f1 ();
+ double d972 = f1 ();
+ double d973 = f1 ();
+ double d974 = f1 ();
+ double d975 = f1 ();
+ double d976 = f1 ();
+ double d977 = f1 ();
+ double d978 = f1 ();
+ double d979 = f1 ();
+ double d980 = f1 ();
+ double d981 = f1 ();
+ double d982 = f1 ();
+ double d983 = f1 ();
+ double d984 = f1 ();
+ double d985 = f1 ();
+ double d986 = f1 ();
+ double d987 = f1 ();
+ double d988 = f1 ();
+ double d989 = f1 ();
+ double d990 = f1 ();
+ double d991 = f1 ();
+ double d992 = f1 ();
+ double d993 = f1 ();
+ double d994 = f1 ();
+ double d995 = f1 ();
+ double d996 = f1 ();
+ double d997 = f1 ();
+ double d998 = f1 ();
+ double d999 = f1 ();
+
+ double x = 0;
+ x = f2 (x, d000);
+ x = f2 (x, d001);
+ x = f2 (x, d002);
+ x = f2 (x, d003);
+ x = f2 (x, d004);
+ x = f2 (x, d005);
+ x = f2 (x, d006);
+ x = f2 (x, d007);
+ x = f2 (x, d008);
+ x = f2 (x, d009);
+ x = f2 (x, d010);
+ x = f2 (x, d011);
+ x = f2 (x, d012);
+ x = f2 (x, d013);
+ x = f2 (x, d014);
+ x = f2 (x, d015);
+ x = f2 (x, d016);
+ x = f2 (x, d017);
+ x = f2 (x, d018);
+ x = f2 (x, d019);
+ x = f2 (x, d020);
+ x = f2 (x, d021);
+ x = f2 (x, d022);
+ x = f2 (x, d023);
+ x = f2 (x, d024);
+ x = f2 (x, d025);
+ x = f2 (x, d026);
+ x = f2 (x, d027);
+ x = f2 (x, d028);
+ x = f2 (x, d029);
+ x = f2 (x, d030);
+ x = f2 (x, d031);
+ x = f2 (x, d032);
+ x = f2 (x, d033);
+ x = f2 (x, d034);
+ x = f2 (x, d035);
+ x = f2 (x, d036);
+ x = f2 (x, d037);
+ x = f2 (x, d038);
+ x = f2 (x, d039);
+ x = f2 (x, d040);
+ x = f2 (x, d041);
+ x = f2 (x, d042);
+ x = f2 (x, d043);
+ x = f2 (x, d044);
+ x = f2 (x, d045);
+ x = f2 (x, d046);
+ x = f2 (x, d047);
+ x = f2 (x, d048);
+ x = f2 (x, d049);
+ x = f2 (x, d050);
+ x = f2 (x, d051);
+ x = f2 (x, d052);
+ x = f2 (x, d053);
+ x = f2 (x, d054);
+ x = f2 (x, d055);
+ x = f2 (x, d056);
+ x = f2 (x, d057);
+ x = f2 (x, d058);
+ x = f2 (x, d059);
+ x = f2 (x, d060);
+ x = f2 (x, d061);
+ x = f2 (x, d062);
+ x = f2 (x, d063);
+ x = f2 (x, d064);
+ x = f2 (x, d065);
+ x = f2 (x, d066);
+ x = f2 (x, d067);
+ x = f2 (x, d068);
+ x = f2 (x, d069);
+ x = f2 (x, d070);
+ x = f2 (x, d071);
+ x = f2 (x, d072);
+ x = f2 (x, d073);
+ x = f2 (x, d074);
+ x = f2 (x, d075);
+ x = f2 (x, d076);
+ x = f2 (x, d077);
+ x = f2 (x, d078);
+ x = f2 (x, d079);
+ x = f2 (x, d080);
+ x = f2 (x, d081);
+ x = f2 (x, d082);
+ x = f2 (x, d083);
+ x = f2 (x, d084);
+ x = f2 (x, d085);
+ x = f2 (x, d086);
+ x = f2 (x, d087);
+ x = f2 (x, d088);
+ x = f2 (x, d089);
+ x = f2 (x, d090);
+ x = f2 (x, d091);
+ x = f2 (x, d092);
+ x = f2 (x, d093);
+ x = f2 (x, d094);
+ x = f2 (x, d095);
+ x = f2 (x, d096);
+ x = f2 (x, d097);
+ x = f2 (x, d098);
+ x = f2 (x, d099);
+ x = f2 (x, d100);
+ x = f2 (x, d101);
+ x = f2 (x, d102);
+ x = f2 (x, d103);
+ x = f2 (x, d104);
+ x = f2 (x, d105);
+ x = f2 (x, d106);
+ x = f2 (x, d107);
+ x = f2 (x, d108);
+ x = f2 (x, d109);
+ x = f2 (x, d110);
+ x = f2 (x, d111);
+ x = f2 (x, d112);
+ x = f2 (x, d113);
+ x = f2 (x, d114);
+ x = f2 (x, d115);
+ x = f2 (x, d116);
+ x = f2 (x, d117);
+ x = f2 (x, d118);
+ x = f2 (x, d119);
+ x = f2 (x, d120);
+ x = f2 (x, d121);
+ x = f2 (x, d122);
+ x = f2 (x, d123);
+ x = f2 (x, d124);
+ x = f2 (x, d125);
+ x = f2 (x, d126);
+ x = f2 (x, d127);
+ x = f2 (x, d128);
+ x = f2 (x, d129);
+ x = f2 (x, d130);
+ x = f2 (x, d131);
+ x = f2 (x, d132);
+ x = f2 (x, d133);
+ x = f2 (x, d134);
+ x = f2 (x, d135);
+ x = f2 (x, d136);
+ x = f2 (x, d137);
+ x = f2 (x, d138);
+ x = f2 (x, d139);
+ x = f2 (x, d140);
+ x = f2 (x, d141);
+ x = f2 (x, d142);
+ x = f2 (x, d143);
+ x = f2 (x, d144);
+ x = f2 (x, d145);
+ x = f2 (x, d146);
+ x = f2 (x, d147);
+ x = f2 (x, d148);
+ x = f2 (x, d149);
+ x = f2 (x, d150);
+ x = f2 (x, d151);
+ x = f2 (x, d152);
+ x = f2 (x, d153);
+ x = f2 (x, d154);
+ x = f2 (x, d155);
+ x = f2 (x, d156);
+ x = f2 (x, d157);
+ x = f2 (x, d158);
+ x = f2 (x, d159);
+ x = f2 (x, d160);
+ x = f2 (x, d161);
+ x = f2 (x, d162);
+ x = f2 (x, d163);
+ x = f2 (x, d164);
+ x = f2 (x, d165);
+ x = f2 (x, d166);
+ x = f2 (x, d167);
+ x = f2 (x, d168);
+ x = f2 (x, d169);
+ x = f2 (x, d170);
+ x = f2 (x, d171);
+ x = f2 (x, d172);
+ x = f2 (x, d173);
+ x = f2 (x, d174);
+ x = f2 (x, d175);
+ x = f2 (x, d176);
+ x = f2 (x, d177);
+ x = f2 (x, d178);
+ x = f2 (x, d179);
+ x = f2 (x, d180);
+ x = f2 (x, d181);
+ x = f2 (x, d182);
+ x = f2 (x, d183);
+ x = f2 (x, d184);
+ x = f2 (x, d185);
+ x = f2 (x, d186);
+ x = f2 (x, d187);
+ x = f2 (x, d188);
+ x = f2 (x, d189);
+ x = f2 (x, d190);
+ x = f2 (x, d191);
+ x = f2 (x, d192);
+ x = f2 (x, d193);
+ x = f2 (x, d194);
+ x = f2 (x, d195);
+ x = f2 (x, d196);
+ x = f2 (x, d197);
+ x = f2 (x, d198);
+ x = f2 (x, d199);
+ x = f2 (x, d200);
+ x = f2 (x, d201);
+ x = f2 (x, d202);
+ x = f2 (x, d203);
+ x = f2 (x, d204);
+ x = f2 (x, d205);
+ x = f2 (x, d206);
+ x = f2 (x, d207);
+ x = f2 (x, d208);
+ x = f2 (x, d209);
+ x = f2 (x, d210);
+ x = f2 (x, d211);
+ x = f2 (x, d212);
+ x = f2 (x, d213);
+ x = f2 (x, d214);
+ x = f2 (x, d215);
+ x = f2 (x, d216);
+ x = f2 (x, d217);
+ x = f2 (x, d218);
+ x = f2 (x, d219);
+ x = f2 (x, d220);
+ x = f2 (x, d221);
+ x = f2 (x, d222);
+ x = f2 (x, d223);
+ x = f2 (x, d224);
+ x = f2 (x, d225);
+ x = f2 (x, d226);
+ x = f2 (x, d227);
+ x = f2 (x, d228);
+ x = f2 (x, d229);
+ x = f2 (x, d230);
+ x = f2 (x, d231);
+ x = f2 (x, d232);
+ x = f2 (x, d233);
+ x = f2 (x, d234);
+ x = f2 (x, d235);
+ x = f2 (x, d236);
+ x = f2 (x, d237);
+ x = f2 (x, d238);
+ x = f2 (x, d239);
+ x = f2 (x, d240);
+ x = f2 (x, d241);
+ x = f2 (x, d242);
+ x = f2 (x, d243);
+ x = f2 (x, d244);
+ x = f2 (x, d245);
+ x = f2 (x, d246);
+ x = f2 (x, d247);
+ x = f2 (x, d248);
+ x = f2 (x, d249);
+ x = f2 (x, d250);
+ x = f2 (x, d251);
+ x = f2 (x, d252);
+ x = f2 (x, d253);
+ x = f2 (x, d254);
+ x = f2 (x, d255);
+ x = f2 (x, d256);
+ x = f2 (x, d257);
+ x = f2 (x, d258);
+ x = f2 (x, d259);
+ x = f2 (x, d260);
+ x = f2 (x, d261);
+ x = f2 (x, d262);
+ x = f2 (x, d263);
+ x = f2 (x, d264);
+ x = f2 (x, d265);
+ x = f2 (x, d266);
+ x = f2 (x, d267);
+ x = f2 (x, d268);
+ x = f2 (x, d269);
+ x = f2 (x, d270);
+ x = f2 (x, d271);
+ x = f2 (x, d272);
+ x = f2 (x, d273);
+ x = f2 (x, d274);
+ x = f2 (x, d275);
+ x = f2 (x, d276);
+ x = f2 (x, d277);
+ x = f2 (x, d278);
+ x = f2 (x, d279);
+ x = f2 (x, d280);
+ x = f2 (x, d281);
+ x = f2 (x, d282);
+ x = f2 (x, d283);
+ x = f2 (x, d284);
+ x = f2 (x, d285);
+ x = f2 (x, d286);
+ x = f2 (x, d287);
+ x = f2 (x, d288);
+ x = f2 (x, d289);
+ x = f2 (x, d290);
+ x = f2 (x, d291);
+ x = f2 (x, d292);
+ x = f2 (x, d293);
+ x = f2 (x, d294);
+ x = f2 (x, d295);
+ x = f2 (x, d296);
+ x = f2 (x, d297);
+ x = f2 (x, d298);
+ x = f2 (x, d299);
+ x = f2 (x, d300);
+ x = f2 (x, d301);
+ x = f2 (x, d302);
+ x = f2 (x, d303);
+ x = f2 (x, d304);
+ x = f2 (x, d305);
+ x = f2 (x, d306);
+ x = f2 (x, d307);
+ x = f2 (x, d308);
+ x = f2 (x, d309);
+ x = f2 (x, d310);
+ x = f2 (x, d311);
+ x = f2 (x, d312);
+ x = f2 (x, d313);
+ x = f2 (x, d314);
+ x = f2 (x, d315);
+ x = f2 (x, d316);
+ x = f2 (x, d317);
+ x = f2 (x, d318);
+ x = f2 (x, d319);
+ x = f2 (x, d320);
+ x = f2 (x, d321);
+ x = f2 (x, d322);
+ x = f2 (x, d323);
+ x = f2 (x, d324);
+ x = f2 (x, d325);
+ x = f2 (x, d326);
+ x = f2 (x, d327);
+ x = f2 (x, d328);
+ x = f2 (x, d329);
+ x = f2 (x, d330);
+ x = f2 (x, d331);
+ x = f2 (x, d332);
+ x = f2 (x, d333);
+ x = f2 (x, d334);
+ x = f2 (x, d335);
+ x = f2 (x, d336);
+ x = f2 (x, d337);
+ x = f2 (x, d338);
+ x = f2 (x, d339);
+ x = f2 (x, d340);
+ x = f2 (x, d341);
+ x = f2 (x, d342);
+ x = f2 (x, d343);
+ x = f2 (x, d344);
+ x = f2 (x, d345);
+ x = f2 (x, d346);
+ x = f2 (x, d347);
+ x = f2 (x, d348);
+ x = f2 (x, d349);
+ x = f2 (x, d350);
+ x = f2 (x, d351);
+ x = f2 (x, d352);
+ x = f2 (x, d353);
+ x = f2 (x, d354);
+ x = f2 (x, d355);
+ x = f2 (x, d356);
+ x = f2 (x, d357);
+ x = f2 (x, d358);
+ x = f2 (x, d359);
+ x = f2 (x, d360);
+ x = f2 (x, d361);
+ x = f2 (x, d362);
+ x = f2 (x, d363);
+ x = f2 (x, d364);
+ x = f2 (x, d365);
+ x = f2 (x, d366);
+ x = f2 (x, d367);
+ x = f2 (x, d368);
+ x = f2 (x, d369);
+ x = f2 (x, d370);
+ x = f2 (x, d371);
+ x = f2 (x, d372);
+ x = f2 (x, d373);
+ x = f2 (x, d374);
+ x = f2 (x, d375);
+ x = f2 (x, d376);
+ x = f2 (x, d377);
+ x = f2 (x, d378);
+ x = f2 (x, d379);
+ x = f2 (x, d380);
+ x = f2 (x, d381);
+ x = f2 (x, d382);
+ x = f2 (x, d383);
+ x = f2 (x, d384);
+ x = f2 (x, d385);
+ x = f2 (x, d386);
+ x = f2 (x, d387);
+ x = f2 (x, d388);
+ x = f2 (x, d389);
+ x = f2 (x, d390);
+ x = f2 (x, d391);
+ x = f2 (x, d392);
+ x = f2 (x, d393);
+ x = f2 (x, d394);
+ x = f2 (x, d395);
+ x = f2 (x, d396);
+ x = f2 (x, d397);
+ x = f2 (x, d398);
+ x = f2 (x, d399);
+ x = f2 (x, d400);
+ x = f2 (x, d401);
+ x = f2 (x, d402);
+ x = f2 (x, d403);
+ x = f2 (x, d404);
+ x = f2 (x, d405);
+ x = f2 (x, d406);
+ x = f2 (x, d407);
+ x = f2 (x, d408);
+ x = f2 (x, d409);
+ x = f2 (x, d410);
+ x = f2 (x, d411);
+ x = f2 (x, d412);
+ x = f2 (x, d413);
+ x = f2 (x, d414);
+ x = f2 (x, d415);
+ x = f2 (x, d416);
+ x = f2 (x, d417);
+ x = f2 (x, d418);
+ x = f2 (x, d419);
+ x = f2 (x, d420);
+ x = f2 (x, d421);
+ x = f2 (x, d422);
+ x = f2 (x, d423);
+ x = f2 (x, d424);
+ x = f2 (x, d425);
+ x = f2 (x, d426);
+ x = f2 (x, d427);
+ x = f2 (x, d428);
+ x = f2 (x, d429);
+ x = f2 (x, d430);
+ x = f2 (x, d431);
+ x = f2 (x, d432);
+ x = f2 (x, d433);
+ x = f2 (x, d434);
+ x = f2 (x, d435);
+ x = f2 (x, d436);
+ x = f2 (x, d437);
+ x = f2 (x, d438);
+ x = f2 (x, d439);
+ x = f2 (x, d440);
+ x = f2 (x, d441);
+ x = f2 (x, d442);
+ x = f2 (x, d443);
+ x = f2 (x, d444);
+ x = f2 (x, d445);
+ x = f2 (x, d446);
+ x = f2 (x, d447);
+ x = f2 (x, d448);
+ x = f2 (x, d449);
+ x = f2 (x, d450);
+ x = f2 (x, d451);
+ x = f2 (x, d452);
+ x = f2 (x, d453);
+ x = f2 (x, d454);
+ x = f2 (x, d455);
+ x = f2 (x, d456);
+ x = f2 (x, d457);
+ x = f2 (x, d458);
+ x = f2 (x, d459);
+ x = f2 (x, d460);
+ x = f2 (x, d461);
+ x = f2 (x, d462);
+ x = f2 (x, d463);
+ x = f2 (x, d464);
+ x = f2 (x, d465);
+ x = f2 (x, d466);
+ x = f2 (x, d467);
+ x = f2 (x, d468);
+ x = f2 (x, d469);
+ x = f2 (x, d470);
+ x = f2 (x, d471);
+ x = f2 (x, d472);
+ x = f2 (x, d473);
+ x = f2 (x, d474);
+ x = f2 (x, d475);
+ x = f2 (x, d476);
+ x = f2 (x, d477);
+ x = f2 (x, d478);
+ x = f2 (x, d479);
+ x = f2 (x, d480);
+ x = f2 (x, d481);
+ x = f2 (x, d482);
+ x = f2 (x, d483);
+ x = f2 (x, d484);
+ x = f2 (x, d485);
+ x = f2 (x, d486);
+ x = f2 (x, d487);
+ x = f2 (x, d488);
+ x = f2 (x, d489);
+ x = f2 (x, d490);
+ x = f2 (x, d491);
+ x = f2 (x, d492);
+ x = f2 (x, d493);
+ x = f2 (x, d494);
+ x = f2 (x, d495);
+ x = f2 (x, d496);
+ x = f2 (x, d497);
+ x = f2 (x, d498);
+ x = f2 (x, d499);
+ x = f2 (x, d500);
+ x = f2 (x, d501);
+ x = f2 (x, d502);
+ x = f2 (x, d503);
+ x = f2 (x, d504);
+ x = f2 (x, d505);
+ x = f2 (x, d506);
+ x = f2 (x, d507);
+ x = f2 (x, d508);
+ x = f2 (x, d509);
+ x = f2 (x, d510);
+ x = f2 (x, d511);
+ x = f2 (x, d512);
+ x = f2 (x, d513);
+ x = f2 (x, d514);
+ x = f2 (x, d515);
+ x = f2 (x, d516);
+ x = f2 (x, d517);
+ x = f2 (x, d518);
+ x = f2 (x, d519);
+ x = f2 (x, d520);
+ x = f2 (x, d521);
+ x = f2 (x, d522);
+ x = f2 (x, d523);
+ x = f2 (x, d524);
+ x = f2 (x, d525);
+ x = f2 (x, d526);
+ x = f2 (x, d527);
+ x = f2 (x, d528);
+ x = f2 (x, d529);
+ x = f2 (x, d530);
+ x = f2 (x, d531);
+ x = f2 (x, d532);
+ x = f2 (x, d533);
+ x = f2 (x, d534);
+ x = f2 (x, d535);
+ x = f2 (x, d536);
+ x = f2 (x, d537);
+ x = f2 (x, d538);
+ x = f2 (x, d539);
+ x = f2 (x, d540);
+ x = f2 (x, d541);
+ x = f2 (x, d542);
+ x = f2 (x, d543);
+ x = f2 (x, d544);
+ x = f2 (x, d545);
+ x = f2 (x, d546);
+ x = f2 (x, d547);
+ x = f2 (x, d548);
+ x = f2 (x, d549);
+ x = f2 (x, d550);
+ x = f2 (x, d551);
+ x = f2 (x, d552);
+ x = f2 (x, d553);
+ x = f2 (x, d554);
+ x = f2 (x, d555);
+ x = f2 (x, d556);
+ x = f2 (x, d557);
+ x = f2 (x, d558);
+ x = f2 (x, d559);
+ x = f2 (x, d560);
+ x = f2 (x, d561);
+ x = f2 (x, d562);
+ x = f2 (x, d563);
+ x = f2 (x, d564);
+ x = f2 (x, d565);
+ x = f2 (x, d566);
+ x = f2 (x, d567);
+ x = f2 (x, d568);
+ x = f2 (x, d569);
+ x = f2 (x, d570);
+ x = f2 (x, d571);
+ x = f2 (x, d572);
+ x = f2 (x, d573);
+ x = f2 (x, d574);
+ x = f2 (x, d575);
+ x = f2 (x, d576);
+ x = f2 (x, d577);
+ x = f2 (x, d578);
+ x = f2 (x, d579);
+ x = f2 (x, d580);
+ x = f2 (x, d581);
+ x = f2 (x, d582);
+ x = f2 (x, d583);
+ x = f2 (x, d584);
+ x = f2 (x, d585);
+ x = f2 (x, d586);
+ x = f2 (x, d587);
+ x = f2 (x, d588);
+ x = f2 (x, d589);
+ x = f2 (x, d590);
+ x = f2 (x, d591);
+ x = f2 (x, d592);
+ x = f2 (x, d593);
+ x = f2 (x, d594);
+ x = f2 (x, d595);
+ x = f2 (x, d596);
+ x = f2 (x, d597);
+ x = f2 (x, d598);
+ x = f2 (x, d599);
+ x = f2 (x, d600);
+ x = f2 (x, d601);
+ x = f2 (x, d602);
+ x = f2 (x, d603);
+ x = f2 (x, d604);
+ x = f2 (x, d605);
+ x = f2 (x, d606);
+ x = f2 (x, d607);
+ x = f2 (x, d608);
+ x = f2 (x, d609);
+ x = f2 (x, d610);
+ x = f2 (x, d611);
+ x = f2 (x, d612);
+ x = f2 (x, d613);
+ x = f2 (x, d614);
+ x = f2 (x, d615);
+ x = f2 (x, d616);
+ x = f2 (x, d617);
+ x = f2 (x, d618);
+ x = f2 (x, d619);
+ x = f2 (x, d620);
+ x = f2 (x, d621);
+ x = f2 (x, d622);
+ x = f2 (x, d623);
+ x = f2 (x, d624);
+ x = f2 (x, d625);
+ x = f2 (x, d626);
+ x = f2 (x, d627);
+ x = f2 (x, d628);
+ x = f2 (x, d629);
+ x = f2 (x, d630);
+ x = f2 (x, d631);
+ x = f2 (x, d632);
+ x = f2 (x, d633);
+ x = f2 (x, d634);
+ x = f2 (x, d635);
+ x = f2 (x, d636);
+ x = f2 (x, d637);
+ x = f2 (x, d638);
+ x = f2 (x, d639);
+ x = f2 (x, d640);
+ x = f2 (x, d641);
+ x = f2 (x, d642);
+ x = f2 (x, d643);
+ x = f2 (x, d644);
+ x = f2 (x, d645);
+ x = f2 (x, d646);
+ x = f2 (x, d647);
+ x = f2 (x, d648);
+ x = f2 (x, d649);
+ x = f2 (x, d650);
+ x = f2 (x, d651);
+ x = f2 (x, d652);
+ x = f2 (x, d653);
+ x = f2 (x, d654);
+ x = f2 (x, d655);
+ x = f2 (x, d656);
+ x = f2 (x, d657);
+ x = f2 (x, d658);
+ x = f2 (x, d659);
+ x = f2 (x, d660);
+ x = f2 (x, d661);
+ x = f2 (x, d662);
+ x = f2 (x, d663);
+ x = f2 (x, d664);
+ x = f2 (x, d665);
+ x = f2 (x, d666);
+ x = f2 (x, d667);
+ x = f2 (x, d668);
+ x = f2 (x, d669);
+ x = f2 (x, d670);
+ x = f2 (x, d671);
+ x = f2 (x, d672);
+ x = f2 (x, d673);
+ x = f2 (x, d674);
+ x = f2 (x, d675);
+ x = f2 (x, d676);
+ x = f2 (x, d677);
+ x = f2 (x, d678);
+ x = f2 (x, d679);
+ x = f2 (x, d680);
+ x = f2 (x, d681);
+ x = f2 (x, d682);
+ x = f2 (x, d683);
+ x = f2 (x, d684);
+ x = f2 (x, d685);
+ x = f2 (x, d686);
+ x = f2 (x, d687);
+ x = f2 (x, d688);
+ x = f2 (x, d689);
+ x = f2 (x, d690);
+ x = f2 (x, d691);
+ x = f2 (x, d692);
+ x = f2 (x, d693);
+ x = f2 (x, d694);
+ x = f2 (x, d695);
+ x = f2 (x, d696);
+ x = f2 (x, d697);
+ x = f2 (x, d698);
+ x = f2 (x, d699);
+ x = f2 (x, d700);
+ x = f2 (x, d701);
+ x = f2 (x, d702);
+ x = f2 (x, d703);
+ x = f2 (x, d704);
+ x = f2 (x, d705);
+ x = f2 (x, d706);
+ x = f2 (x, d707);
+ x = f2 (x, d708);
+ x = f2 (x, d709);
+ x = f2 (x, d710);
+ x = f2 (x, d711);
+ x = f2 (x, d712);
+ x = f2 (x, d713);
+ x = f2 (x, d714);
+ x = f2 (x, d715);
+ x = f2 (x, d716);
+ x = f2 (x, d717);
+ x = f2 (x, d718);
+ x = f2 (x, d719);
+ x = f2 (x, d720);
+ x = f2 (x, d721);
+ x = f2 (x, d722);
+ x = f2 (x, d723);
+ x = f2 (x, d724);
+ x = f2 (x, d725);
+ x = f2 (x, d726);
+ x = f2 (x, d727);
+ x = f2 (x, d728);
+ x = f2 (x, d729);
+ x = f2 (x, d730);
+ x = f2 (x, d731);
+ x = f2 (x, d732);
+ x = f2 (x, d733);
+ x = f2 (x, d734);
+ x = f2 (x, d735);
+ x = f2 (x, d736);
+ x = f2 (x, d737);
+ x = f2 (x, d738);
+ x = f2 (x, d739);
+ x = f2 (x, d740);
+ x = f2 (x, d741);
+ x = f2 (x, d742);
+ x = f2 (x, d743);
+ x = f2 (x, d744);
+ x = f2 (x, d745);
+ x = f2 (x, d746);
+ x = f2 (x, d747);
+ x = f2 (x, d748);
+ x = f2 (x, d749);
+ x = f2 (x, d750);
+ x = f2 (x, d751);
+ x = f2 (x, d752);
+ x = f2 (x, d753);
+ x = f2 (x, d754);
+ x = f2 (x, d755);
+ x = f2 (x, d756);
+ x = f2 (x, d757);
+ x = f2 (x, d758);
+ x = f2 (x, d759);
+ x = f2 (x, d760);
+ x = f2 (x, d761);
+ x = f2 (x, d762);
+ x = f2 (x, d763);
+ x = f2 (x, d764);
+ x = f2 (x, d765);
+ x = f2 (x, d766);
+ x = f2 (x, d767);
+ x = f2 (x, d768);
+ x = f2 (x, d769);
+ x = f2 (x, d770);
+ x = f2 (x, d771);
+ x = f2 (x, d772);
+ x = f2 (x, d773);
+ x = f2 (x, d774);
+ x = f2 (x, d775);
+ x = f2 (x, d776);
+ x = f2 (x, d777);
+ x = f2 (x, d778);
+ x = f2 (x, d779);
+ x = f2 (x, d780);
+ x = f2 (x, d781);
+ x = f2 (x, d782);
+ x = f2 (x, d783);
+ x = f2 (x, d784);
+ x = f2 (x, d785);
+ x = f2 (x, d786);
+ x = f2 (x, d787);
+ x = f2 (x, d788);
+ x = f2 (x, d789);
+ x = f2 (x, d790);
+ x = f2 (x, d791);
+ x = f2 (x, d792);
+ x = f2 (x, d793);
+ x = f2 (x, d794);
+ x = f2 (x, d795);
+ x = f2 (x, d796);
+ x = f2 (x, d797);
+ x = f2 (x, d798);
+ x = f2 (x, d799);
+ x = f2 (x, d800);
+ x = f2 (x, d801);
+ x = f2 (x, d802);
+ x = f2 (x, d803);
+ x = f2 (x, d804);
+ x = f2 (x, d805);
+ x = f2 (x, d806);
+ x = f2 (x, d807);
+ x = f2 (x, d808);
+ x = f2 (x, d809);
+ x = f2 (x, d810);
+ x = f2 (x, d811);
+ x = f2 (x, d812);
+ x = f2 (x, d813);
+ x = f2 (x, d814);
+ x = f2 (x, d815);
+ x = f2 (x, d816);
+ x = f2 (x, d817);
+ x = f2 (x, d818);
+ x = f2 (x, d819);
+ x = f2 (x, d820);
+ x = f2 (x, d821);
+ x = f2 (x, d822);
+ x = f2 (x, d823);
+ x = f2 (x, d824);
+ x = f2 (x, d825);
+ x = f2 (x, d826);
+ x = f2 (x, d827);
+ x = f2 (x, d828);
+ x = f2 (x, d829);
+ x = f2 (x, d830);
+ x = f2 (x, d831);
+ x = f2 (x, d832);
+ x = f2 (x, d833);
+ x = f2 (x, d834);
+ x = f2 (x, d835);
+ x = f2 (x, d836);
+ x = f2 (x, d837);
+ x = f2 (x, d838);
+ x = f2 (x, d839);
+ x = f2 (x, d840);
+ x = f2 (x, d841);
+ x = f2 (x, d842);
+ x = f2 (x, d843);
+ x = f2 (x, d844);
+ x = f2 (x, d845);
+ x = f2 (x, d846);
+ x = f2 (x, d847);
+ x = f2 (x, d848);
+ x = f2 (x, d849);
+ x = f2 (x, d850);
+ x = f2 (x, d851);
+ x = f2 (x, d852);
+ x = f2 (x, d853);
+ x = f2 (x, d854);
+ x = f2 (x, d855);
+ x = f2 (x, d856);
+ x = f2 (x, d857);
+ x = f2 (x, d858);
+ x = f2 (x, d859);
+ x = f2 (x, d860);
+ x = f2 (x, d861);
+ x = f2 (x, d862);
+ x = f2 (x, d863);
+ x = f2 (x, d864);
+ x = f2 (x, d865);
+ x = f2 (x, d866);
+ x = f2 (x, d867);
+ x = f2 (x, d868);
+ x = f2 (x, d869);
+ x = f2 (x, d870);
+ x = f2 (x, d871);
+ x = f2 (x, d872);
+ x = f2 (x, d873);
+ x = f2 (x, d874);
+ x = f2 (x, d875);
+ x = f2 (x, d876);
+ x = f2 (x, d877);
+ x = f2 (x, d878);
+ x = f2 (x, d879);
+ x = f2 (x, d880);
+ x = f2 (x, d881);
+ x = f2 (x, d882);
+ x = f2 (x, d883);
+ x = f2 (x, d884);
+ x = f2 (x, d885);
+ x = f2 (x, d886);
+ x = f2 (x, d887);
+ x = f2 (x, d888);
+ x = f2 (x, d889);
+ x = f2 (x, d890);
+ x = f2 (x, d891);
+ x = f2 (x, d892);
+ x = f2 (x, d893);
+ x = f2 (x, d894);
+ x = f2 (x, d895);
+ x = f2 (x, d896);
+ x = f2 (x, d897);
+ x = f2 (x, d898);
+ x = f2 (x, d899);
+ x = f2 (x, d900);
+ x = f2 (x, d901);
+ x = f2 (x, d902);
+ x = f2 (x, d903);
+ x = f2 (x, d904);
+ x = f2 (x, d905);
+ x = f2 (x, d906);
+ x = f2 (x, d907);
+ x = f2 (x, d908);
+ x = f2 (x, d909);
+ x = f2 (x, d910);
+ x = f2 (x, d911);
+ x = f2 (x, d912);
+ x = f2 (x, d913);
+ x = f2 (x, d914);
+ x = f2 (x, d915);
+ x = f2 (x, d916);
+ x = f2 (x, d917);
+ x = f2 (x, d918);
+ x = f2 (x, d919);
+ x = f2 (x, d920);
+ x = f2 (x, d921);
+ x = f2 (x, d922);
+ x = f2 (x, d923);
+ x = f2 (x, d924);
+ x = f2 (x, d925);
+ x = f2 (x, d926);
+ x = f2 (x, d927);
+ x = f2 (x, d928);
+ x = f2 (x, d929);
+ x = f2 (x, d930);
+ x = f2 (x, d931);
+ x = f2 (x, d932);
+ x = f2 (x, d933);
+ x = f2 (x, d934);
+ x = f2 (x, d935);
+ x = f2 (x, d936);
+ x = f2 (x, d937);
+ x = f2 (x, d938);
+ x = f2 (x, d939);
+ x = f2 (x, d940);
+ x = f2 (x, d941);
+ x = f2 (x, d942);
+ x = f2 (x, d943);
+ x = f2 (x, d944);
+ x = f2 (x, d945);
+ x = f2 (x, d946);
+ x = f2 (x, d947);
+ x = f2 (x, d948);
+ x = f2 (x, d949);
+ x = f2 (x, d950);
+ x = f2 (x, d951);
+ x = f2 (x, d952);
+ x = f2 (x, d953);
+ x = f2 (x, d954);
+ x = f2 (x, d955);
+ x = f2 (x, d956);
+ x = f2 (x, d957);
+ x = f2 (x, d958);
+ x = f2 (x, d959);
+ x = f2 (x, d960);
+ x = f2 (x, d961);
+ x = f2 (x, d962);
+ x = f2 (x, d963);
+ x = f2 (x, d964);
+ x = f2 (x, d965);
+ x = f2 (x, d966);
+ x = f2 (x, d967);
+ x = f2 (x, d968);
+ x = f2 (x, d969);
+ x = f2 (x, d970);
+ x = f2 (x, d971);
+ x = f2 (x, d972);
+ x = f2 (x, d973);
+ x = f2 (x, d974);
+ x = f2 (x, d975);
+ x = f2 (x, d976);
+ x = f2 (x, d977);
+ x = f2 (x, d978);
+ x = f2 (x, d979);
+ x = f2 (x, d980);
+ x = f2 (x, d981);
+ x = f2 (x, d982);
+ x = f2 (x, d983);
+ x = f2 (x, d984);
+ x = f2 (x, d985);
+ x = f2 (x, d986);
+ x = f2 (x, d987);
+ x = f2 (x, d988);
+ x = f2 (x, d989);
+ x = f2 (x, d990);
+ x = f2 (x, d991);
+ x = f2 (x, d992);
+ x = f2 (x, d993);
+ x = f2 (x, d994);
+ x = f2 (x, d995);
+ x = f2 (x, d996);
+ x = f2 (x, d997);
+ x = f2 (x, d998);
+ x = f2 (x, d999);
+ return x;
+}
+
+/* { dg-final { scan-rtl-dump-times "Stack clash inline probes" 1 "pro_and_epilogue" } } */
+/* { dg-final { scan-rtl-dump-times "Stack clash residual allocation in prologue" 1 "pro_and_epilogue" } } */
+/* { dg-final { scan-rtl-dump-times "Stack clash not noreturn" 1 "pro_and_epilogue" } } */
+
+/* f3 is not a leaf
+/* { dg-final { scan-rtl-dump-times "Stack clash no frame pointer needed" 1 "pro_and_epilogue" { target { ! frame_pointer_for_non_leaf } } } } */
+/* { dg-final { scan-rtl-dump-times "Stack clash frame pointer needed" 1 "pro_and_epilogue" { target { frame_pointer_for_non_leaf } } } } */
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 821cea9cb33..2c669a9822f 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -5421,11 +5421,15 @@ proc check_effective_target_autoincdec { } {
proc check_effective_target_supports_stack_clash_protection { } {
# Temporary until the target bits are fully ACK'd.
-# if { [istarget aarch*-*-*] || [istarget x86_64-*-*]
-# || [istarget i?86-*-*] || [istarget s390*-*-*]
+# if { [istarget aarch*-*-*]
+# || [istarget s390*-*-*]
# || [istarget powerpc*-*-*] || [istarget rs6000*-*-*] } {
# return 1
# }
+
+ if { [istarget x86_64-*-*] || [istarget i?86-*-*] } {
+ return 1
+ }
return 0
}
|