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
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
|
2024-10-25 Tom Tromey <tromey@adacore.com>
* gcc-interface/decl.cc (gnat_to_gnu_entity): Use gnu_fat_type as the type
context for a XUB type.
2024-10-25 Tom Tromey <tromey@adacore.com>
* gcc-interface/decl.cc (gnat_to_gnu_entity): Update some calls to
create_type_decl.
* gcc-interface/gigi.h (create_type_decl): Add can_be_nameless parameter.
* gcc-interface/utils.cc (create_type_decl): Add can_be_nameless
parameter. Set DECL_NAMELESS on type decl.
2024-10-25 Tom Tromey <tromey@adacore.com>
* gcc-interface/utils.cc (record_builtin_type, create_type_stub_decl):
Set DECL_NAMELESS on type decls.
2024-10-25 Tom Tromey <tromey@adacore.com>
* gcc-interface/decl.cc (gnat_to_gnu_entity): Pass 'true' to
create_type_decl when creating XUA type.
2024-10-25 Tom Tromey <tromey@adacore.com>
* gcc-interface/decl.cc (gnat_to_gnu_entity): Set TYPE_NAMELESS on
XUB types.
2024-10-25 Tom Tromey <tromey@adacore.com>
* gcc-interface/decl.cc (gnat_to_gnu_entity): Pass artificial_p to
build_unc_object_type.
* gcc-interface/gigi.h (build_unc_object_type): Update.
* gcc-interface/utils.cc (build_unc_object_type) Add artificial_p
parameter.
(build_unc_object_type_from_ptr): Update.
2024-10-25 Tom Tromey <tromey@adacore.com>
* gcc-interface/decl.cc (is_artificial): New function.
(gnat_to_gnu_entity): Use it.
2024-10-25 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.cc (Call_to_gnu): If the formal is passed by
reference and the actual is a type conversion but not addressable,
create the temporary in the target type of the conversion if this
is needed to enforce strict aliasing.
2024-10-25 Eric Botcazou <ebotcazou@adacore.com>
PR ada/116551
* gcc-interface/trans.cc (node_is_atomic) <N_Identifier>: Return
false if the type of the entity is an unconstrained array type.
(node_is_volatile_full_access) <N_Identifier>: Likewise.
2024-10-25 Bob Duff <duff@adacore.com>
* sem_ch10.adb (Analyze_With_Clause): Temporarily disable warning.
2024-10-25 Bob Duff <duff@adacore.com>
* sem_ch10.adb: (Analyze_With_Clause): Check for self-referential
with clause. Give a warning, and set Is_Implicit_With, which we
are reusing in this obscure case even though it's not really
implicit.
(Analyze_Context): Remove check for self-referential with clause.
It wasn't correct -- it only triggered for Acts_As_Spec
subprograms. Corrected check is now in Analyze_With_Clause.
(Implicit_With): Rename to be Is_Implicit_With. Misc cleanup,
comment fixes.
(Process_Spec_Clauses): Remove default for Exit_On_Self parameter.
Use "exit when" instead of if statement.
* sinfo.ads (Implicit_With): Rename to be Is_Implicit_With.
Document new use for self-referential withs.
* ali.adb (Scan_ALI): Use an aggregate to initialize Withs entry.
* exp_put_image.adb (Preload_Root_Buffer_Type): Make this a
once-only procedure.
* sem_util.ads (Is_Ancestor_Package): Fix comment -- a libraryunit
is an ancestor of itself, but this doesn't return True in that
case.
* sem_util.adb (Is_Ancestor_Package): Better to initialize things
on their declaration.
* lib-load.adb: Minor comment fix.
* sem_prag.adb: Implicit_With --> Is_Implicit_With. Minor comment
fix.
* gen_il-fields.ads: Implicit_With --> Is_Implicit_With.
* gen_il-gen-gen_nodes.adb: Likewise
* lib.adb: Likewise
* lib-writ.adb: Likewise
* rtsfind.adb: Likewise
* sem_cat.adb: Likewise
* sem_ch12.adb: Likewise
* sem_ch8.adb: Likewise
* sem_elab.adb: Likewise
* sem_warn.adb: Likewise
* gcc-interface/trans.cc: (Implicit_With): Rename to be
Is_Implicit_With.
2024-10-25 Tom Tromey <tromey@adacore.com>
* gcc-interface/trans.cc (namespace_map): New global.
(Compilation_Unit_to_gnu): Also handle N_With_Clause and
N_Use_Package_Clause.
(get_or_create_namespace, get_namespace): New functions.
(gnat_to_gnu) <N_Package_Renaming_Declaration>: Call
get_namespace.
<N_Use_Package_Clause, N_With_Clause>: Likewise.
2024-10-25 Eric Botcazou <ebotcazou@adacore.com>
* freeze.adb (Freeze_Expression.In_Expanded_Body): Tweak comments.
2024-10-25 Javier Miranda <miranda@adacore.com>
* freeze.adb (Freeze_Entity): If the entity is an access-to-subprogram
type declaration that pre/postcondition contracts, build the
wrapper
(if not previously done as part of processing aspects).
* sem_ch3.adb (Build_Access_Subprogram_Wrapper): Add missing support
for building the wrapper when the access type has pragmas
Pre_Class/Post_Class.
(Build_Access_Subprogram_Wrapper_Declaration): New subprogram.
* sem_ch3.ads (Build_Access_Subprogram_Wrapper): Spec moved to the
public part of the package.
* sem_prag.adb (Analyze_Pre_Post_Condition): Store in the tree copy of
class-wide pre/postcondition expression; required to merge it with
inherited conditions.
(Is_Valid_Assertion_Kind): Added Pre_Class and Post_Class.
2024-10-25 Richard Kenner <kenner@adacore.com>
* doc/gnat_ugn/about_this_guide.rst: Numerous changes to language
and style and add some LLVM-specific information.
* doc/gnat_ugn/elaboration_order_handling_in_gnat.rst: Likewise.
* doc/gnat_ugn/example_of_binder_output.rst: Likewise.
* doc/gnat_ugn/getting_started_with_gnat.rst: Likewise.
* doc/gnat_ugn/gnat_and_program_execution.rst: Likewise.
* doc/gnat_ugn/gnat_utility_programs.rst: Likewise.
* doc/gnat_ugn/inline_assembler.rst: Likewise.
* doc/gnat_ugn/platform_specific_information.rst: Likewise.
* doc/gnat_ugn/the_gnat_compilation_model.rst: Likewise.
* gnat_ugn.texi: Regenerate.
2024-10-25 Eric Botcazou <ebotcazou@adacore.com>
PR ada/43485
* libgnarl/a-retide.adb: Add with clause for System.Soft_Links.
(Delay_Until): Defer and undefer abort around the call to the
Timed_Delay routine of System.Task_Primitives.Operations.
2024-10-25 Eric Botcazou <ebotcazou@adacore.com>
* freeze.adb (Freeze_Expression.In_Expanded_Body): Also return True
for the body of a helper/wrapper built for class-wide preconditions.
2024-10-25 Javier Miranda <miranda@adacore.com>
* sem_prag.adb (Analyze_Pre_Post_Condition): Allow the use of
pragma Pre_Class/Post_Class with abstract subprograms.
2024-10-25 Javier Miranda <miranda@adacore.com>
* sem_ch3.adb (Record_Type_Definition): For tagged types, add
the missing decoration to the First_Entity in the corresponding
class-wide type entity.
2024-10-25 Ronan Desplanques <desplanques@adacore.com>
* doc/gnat_rm/gnat_language_extensions.rst: Adjust documentation.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2024-10-25 Richard Kenner <kenner@adacore.com>
* comperr.ads (Compiler_Error): Update documentation.
2024-10-25 Eric Botcazou <ebotcazou@adacore.com>
* uintp.ads (Type_Size_For): New function declaration.
* uintp.adb (Type_Size_For): New function body.
* exp_imgv.adb (Rewrite_Object_Image): Call Type_Size_For to get
the size of a narrower integer type.
2024-10-25 Tonu Naks <naks@adacore.com>
* doc/gnat_rm/gnat_language_extensions.rst: update
simpler accessibility model
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2024-10-25 Bob Duff <duff@adacore.com>
* doc/gnat_rm/gnat_language_extensions.rst:
Minor wording improvments.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2024-10-25 squirek <squirek@adacore.com>
* libgnarl/s-taprop__mingw.adb: Modify stack size and update
documentation.
2024-10-25 Javier Miranda <miranda@adacore.com>
* gen_il-fields.ads: New node field (Is_Expanded_Prefixed_Call).
* gen_il-gen-gen_nodes.adb: New semantic field for N_Function_Call
and N_Procedure_Call_Statement nodes.
* sem_ch4.adb (Complete_Object_Operation): Mark the rewritten node
with the Is_Expanded_Prefixed_Call flag.
* sem_res.adb (Check_Prefixed_Call): Code cleanup and addition of
documentation.
(Resolve_Actuals): Add a null-exclusion check on the
prefix of the call when it is an access-type.
* sinfo.ads: Adding new semantic flag (Is_Expanded_Prefixed_Call)
to N_Function_Call and N_Procedure_Call_Statement nodes.
* debug.adb: Adding documentation for switch d_P.
2024-10-25 Raphaël AMIARD <amiard@adacore.com>
* sem_ch13.adb (Analyze_One_Aspect): change the call to
`Error_Msg_GNAT_Extension` to allow this aspect in core
extensions. Put the code path in core extensions.
* exp_util.adb (Name_Of_Controlled_Prim_Op): Put the code path
in core extensions
2024-10-25 Eric Botcazou <ebotcazou@adacore.com>
* sem_type.ads (Interp ): Add Opnd_Typ component and remove default
value for Abstract_Op component.
(Add_One_Interp): Rename Opnd_Type parameter to Opnd_Typ.
* sem_type.adb (Add_One_Interp): Likewise.
(Add_One_Interp.Add_Entry): Record the operand type as well.
(Collect_Interp): Record Empty for the operand type.
(Disambiguate.Is_Ambiguous_Boolean_Operator): New predicate.
(Disambiguate): Use it to detect recorded ambiguity cases.
* sem_ch4.adb (Find_Comparison_Equality_Types): Add commentary.
2024-10-25 Javier Miranda <miranda@adacore.com>
* sem_ch8.adb (Freeze_Actual_Profile): Do not report error
on incomplete types, since they do not cause freezing.
2024-10-25 Eric Botcazou <ebotcazou@adacore.com>
* namet.adb (Append_Decoded_With_Brackets): Fix condition for the
cheap test at the beginning of the loop.
2024-10-25 Eric Botcazou <ebotcazou@adacore.com>
PR ada/115507
* rtsfind.ads (RE_Id): Add RE_Enum_[Wide_]Wide_String_To_String.
(RE_Unit_Table): Add entries for the new values.
* exp_attr.adb (Is_User_Defined_Enumeration_Type): New predicate.
(Expand_N_Attribute_Reference) <Attribute_Wide_Value>: Build a call
to RE_Enum_Wide_String_To_String for user-defined enumeration types.
<Attribute_Wide_Wide_Value>: Likewise with
RE_Enum_Wide_Wide_String_To_String.
* exp_imgv.adb (Expand_Value_Attribute): Adjust to above.
* libgnat/s-wchwts.ads (Enum_Wide_String_To_String): New function.
(Enum_Wide_Wide_String_To_String): Likewise.
* libgnat/s-wchwts.adb: Add clauses for System.Case_Util.
(Normalize_String): New local procedure.
(Enum_Wide_String_To_String): New function body.
(Enum_Wide_Wide_String_To_String): Likewise.
2024-10-25 Javier Miranda <miranda@adacore.com>
* sem_res.adb (Resolve_Actuals): Add checks for incomplete
type actuals.
2024-10-25 Raphaël AMIARD <amiard@adacore.com>
* par-ch5.adb (P_Sequence_Of_Statements): Forbid repr clauses in
handled_statements.
2024-10-25 Raphaël AMIARD <amiard@adacore.com>
* sem_util.ads: Introduce Inspect_Deferred_Constant_Completion
on a single object declaration, to better factorize the code
* sem_util.adb: Introduce aforementioned overload
* sem_ch4.adb (Analyze_Expression_With_Actions): Check deferred
constant completions
* sem_ch5.adb (Analyze_Statements): Check deferred constant
completions
2024-10-25 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch6.adb (Expand_Actuals.Is_Legal_Copy): Return True for an
initialization procedure with a full access formal parameter.
(Expand_Actuals.Requires_Atomic_Or_Volatile_Copy): Return True if
the formal parameter is of a full access unconstrained array type.
2024-10-24 David Malcolm <dmalcolm@redhat.com>
Gaius Mulley <gaiusmod2@gmail.com>
PR other/116613
* gcc-interface/misc.cc: Add #define INCLUDE_MEMORY
* gcc-interface/trans.cc: Likewise.
* gcc-interface/utils.cc: Likewise.
2024-10-11 Eric Botcazou <ebotcazou@adacore.com>
PR ada/116498
PR ada/117087
* gcc-interface/decl.cc (validate_size): Fix thinko.
2024-10-09 Eric Botcazou <ebotcazou@adacore.com>
PR ada/117038
* fe.h (struct c_array): Add 'const' to declaration of pointer.
(C_Source_Buffer): Use consistent formatting.
* par-ch3.adb (P_Component_Items): Properly set Aliased_Present on
access definition.
* sinput.ads: Remove clause for Interfaces.C.
(C_Array): Change type of Length to Integer and make both components
aliased. Remove Convention aspect.
(C_Source_Buffer): Remove all aspects.
* sinput.adb (C_Source_Buffer): Adjust to above change.
2024-10-09 Eric Botcazou <ebotcazou@adacore.com>
* Makefile.rtl: Remove HP-UX 10 section.
* libgnarl/s-osinte__hpux-dce.ads: Delete.
* libgnarl/s-osinte__hpux-dce.adb: Likewise.
* libgnarl/s-taprop__hpux-dce.adb: Likewise.
* libgnarl/s-taspri__hpux-dce.ads: Likewise.
* libgnat/s-oslock__hpux-dce.ads: Likewise.
2024-10-08 Eric Botcazou <ebotcazou@adacore.com>
PR ada/116498
* gcc-interface/decl.cc (validate_size): Use the size of the default
pointer mode as the minimum size for access types and fat pointers.
2024-10-08 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.cc (Raise_Error_to_gnu) <CE_Invalid_Data>:
Do not the generate range information if the value is a call to a
Rep_To_Pos function.
2024-10-08 Olivier Hainque <hainque@adacore.com>
* sigtramp-armdroid.c: Refactor into ...
* sigtramp-android.c, sigtramp-android-asm.h: New files.
* Makefile.rtl (arm/aarch64-android section): Add
sigtramp-android.o to EXTRA_LIBGNAT_OBJS unconditionally. Add
sigtramp.h and sigtramp-android-asm.h to EXTRA_LIBGNAT_SRCS.
* init.c (android section, __gnat_error_handler): Defer to
__gnat_sigramp unconditionally again.
* sigtramp.h: Adjust comments to allow neutral signal handling
relays, merely forwarding to the underlying handler without any
intermediate CFI magic.
2024-10-08 Eric Botcazou <ebotcazou@adacore.com>
PR ada/115507
* exp_imgv.adb (Expand_Valid_Value_Attribute): Add actual parameter
for Is_Wide formal in the call to Valid_Value_Enumeration_NN.
(Expand_Value_Attribute): Likewise.
* libgnat/s-vaen16.ads (Value_Enumeration_16): Add Is_Wide formal.
(Valid_Value_Enumeration_16): Likewise.
* libgnat/s-vaen32.ads (Value_Enumeration_32): Likewise.
(Valid_Value_Enumeration_32): Likewise.
* libgnat/s-vaenu8.ads (Value_Enumeration_8): Likewise.
(Valid_Value_Enumeration_8): Likewise.
* libgnat/s-valboo.adb (Value_Boolean): Pass True for To_Upper_Case
formal parameter in call to Normalize_String.
* libgnat/s-valcha.adb (Value_Character): Likewise.
* libgnat/s-valuen.ads (Value_Enumeration): Add Is_Wide formal.
(Valid_Value_Enumeration): Likewise.
* libgnat/s-valuen.adb (Value_Enumeration_Pos): Likewise and pass
its negation for To_Upper_Case formal in call to Normalize_String.
(Valid_Value_Enumeration): Add Is_Wide formal and forward it in
call to Value_Enumeration_Pos.
(Value_Enumeration): Likewise.
* libgnat/s-valuti.ads (Normalize_String): Add To_Upper_Case formal
parameter and adjust post-condition accordingly.
* libgnat/s-valuti.adb (Normalize_String): Add To_Upper_Case formal
parameter and adjust implementation accordingly.
* libgnat/s-valwch.adb (Value_Wide_Wide_Character): Pass False for
To_Upper_Case formal parameter in call to Normalize_String.
2024-10-08 Eric Botcazou <ebotcazou@adacore.com>
PR ada/114636
* sem_ch12.adb (Check_Formal_Package_Instance): For a defaulted
formal discrete type, skip the generated implicit base type.
2024-10-08 Eric Botcazou <ebotcazou@adacore.com>
PR ada/115535
* exp_put_image.adb (Build_Elementary_Put_Image_Call): Use the size
of the underlying type to find the support type.
2024-10-08 Eric Botcazou <ebotcazou@adacore.com>
PR ada/114640
* exp_util.adb (Find_Hook_Context): For a node present within a
conditional expression, do not return an N_Elsif_Part node.
2024-10-08 Viljar Indus <indus@adacore.com>
* diagnostics-constructors.adb
(Make_Mixed_Container_Aggregate_Error): New function for the error
message
(Record_Mixed_Container_Aggregate_Error): New function for the
error message.
* diagnostics-constructors.ads: Likewise.
* diagnostics-repository.ads: register new diagnostics id
* diagnostics.ads: add new diagnostics id
* errout.adb (First_And_Last_Node): Detect the span for component
associations.
* sem_aggr.adb (Resolve_Container_Aggregate): reject container
aggregates that have both named and positional elements.
2024-10-08 Ronan Desplanques <desplanques@adacore.com>
* snames.ads-tmpl: Add new pragma definition.
* par-prag.adb (Prag): Handle new pragma.
* sem_prag.adb (Analyze_Pragma): Implement new pragma.
2024-10-08 Ronan Desplanques <desplanques@adacore.com>
* snames.ads-tmpl: Tweak position of comment.
2024-10-08 Tonu Naks <naks@adacore.com>
* doc/gnat_rm/gnat_language_extensions.rst: replace
references to RFC's with appropriate text from the rfc
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2024-10-08 Ronan Desplanques <desplanques@adacore.com>
* lib-writ.ads (Add_Preprocessing_Dependency): Update
documentation comment.
* sem_ch3.adb (Apply_External_Initialization): Add call to
Add_Preprocessing_Dependency.
2024-10-08 Viljar Indus <indus@adacore.com>
* exp_aggr.adb (Build_Siz_Exp): Support deriving the size of the
container aggregate with multi-dimensional arrays. Make the
function return an node of an expression instead of an integer.
Additionally calculate the size expression for
Component_Associations.
(To_Int) make this method available for more functions.
(Aggregate_Size) Relocate the calculation of
Componenet_Associations to Build_Siz_Exp.
2024-10-08 Eric Botcazou <ebotcazou@adacore.com>
* exp_tss.ads (Is_Rep_To_Pos): New function declaration.
* exp_tss.adb (Is_Rep_To_Pos): New function body.
* fe.h (Is_Rep_To_Pos): New macro and extern declaration.
2024-10-08 Eric Botcazou <ebotcazou@adacore.com>
* exp_imgv.adb (Rewrite_Object_Image): When the prefix is a type
conversion to Universal_Integer, use its expression directly. When
the prefix is an integer literal with Universal_Integer type, try
to compute a narrower type.
2024-10-08 Raphaël AMIARD <amiard@adacore.com>
* par-ch11.adb (P_Sequence_Of_Statements): Remove Handled
parameter. Always wrap the statements in a block when there are
declarations in it.
* par-ch5.adb: Adapt call to P_Sequence_Of_Statements Update
outdated comment, remove useless `Style_Checks` pragma.
(P_Sequence_Of_Statements): Don't emit an error in core extensions
mode. Emit an error when a non valid declaration is parsed in
sequence of statements.
* par.adb: Adapt P_Sequence_Of_Statements' signature
* doc/gnat_rm/gnat_language_extensions.rst: Adapt documentation
now.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2024-10-08 Ronan Desplanques <desplanques@adacore.com>
* generate_minimal_reproducer.adb (Generate_Minimal_Reproducer):
Fix behavior on child subprograms without specs.
2024-10-08 Steve Baird <baird@adacore.com>
* sem_ch6.adb (Analyze_Subprogram_Body_Helper): Don't freeze here
if Has_Delayed_Freeze returns True.
* sem_type.adb (Valid_Equality_Arg): Treat an incomplete type like
a limited type because neither has an implicitly-defined equality
primitive.
(Covers): If either argument is an incomplete type
whose full view is available, then look through to the full view.
* sem_res.adb (Resolve_Actuals): If the actual parameter type is
complete and the formal parameter type is not, then update the
formal parameter type to use the complete view.
2024-10-08 squirek <squirek@adacore.com>
* sem_ch3.adb (Derived_Type_Declaration): Modify generation of
compile time check.
2024-10-08 Eric Botcazou <ebotcazou@adacore.com>
* libgnat/s-trasym__dwarf.adb (LDAD_Header): New String constant.
(Symbolic_Traceback): Print the load address of the executable at
the beginning if it is not null.
2024-10-08 Steve Baird <baird@adacore.com>
* sem_ch6.adb (Check_Discriminant_Conformance): In testing whether
a default expression is permitted for an access discriminant, we
need to know whether the discriminated type is immutably limited.
Handle another part of this test that cannot easily be handled in
Sem_Aux.Is_Immutably_Limited. This involves declaring a new local
function, Is_Derived_From_Immutably_Limited_Type.
2024-10-08 Steve Baird <baird@adacore.com>
* sem_attr.adb (Resolve_Attribute): When setting the Etype of a
universal-integer-valued attribute reference to the subtype
determined by its context, use the basetype of that subtype
instead of the subtype itself if there is a possibility that the
attribute value will not satisfy the constraints of that subtype.
Otherwise the compiler is, in effect, assuming something that
might not be true. Except use the subtype in the case of a
not-from-source 'Pos attribute reference in order to avoid
breaking things.
2024-10-08 Ronan Desplanques <desplanques@adacore.com>
* comperr.adb (Compiler_Abort): Add call to
Generate_Minimal_Reproducer and replace call to Namet.Unlock with
call to Unlock_If_Locked.
* debug.adb: Document new purpose of -gnatd_m and -gnatd_M.
* fname-uf.adb (Instantiate_SFN_Pattern): New procedure.
(Get_Default_File_Name): New function.
(Get_File_Name): Replace inline code with call to
Instantiate_SFN_Pattern.
* fname-uf.ads (Get_Default_File_Name): New function.
* generate_minimal_reproducer.adb (Generate_Minimal_Reproducer):
New procedure.
* namet.adb (Unlock_If_Locked): New function.
* namet.ads (Unlock_If_Locked): Likewise.
* par-prag.adb (Prag): Add special behavior with -gnatd_M.
* set_targ.adb: Minor fixes to comments.
* gcc-interface/Make-lang.in: Update list of object files.
2024-10-08 Eric Botcazou <ebotcazou@adacore.com>
* exp_aggr.ads (Is_Two_Pass_Aggregate): New function declaration.
* exp_aggr.adb (Is_Two_Pass_Aggregate): New function body.
(Expand_Array_Aggregate): Call Is_Two_Pass_Aggregate to detect the
aggregates that need the 2-pass expansion.
* exp_ch3.adb (Expand_Freeze_Array_Type): In the anonymous array
case, build the initialization procedure if the initial value in
the object declaration is a 2-pass aggregate.
2024-10-08 Ghjuvan Lacambre <lacambre@adacore.com>
* sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Fix
indentation.
2024-10-08 Ronan Desplanques <desplanques@adacore.com>
* aspects.ads: Add entities for External_Initialization.
* checks.adb (Selected_Length_Checks): Add support for
N_External_Initializer nodes.
* doc/gnat_rm/gnat_language_extensions.rst: Add section for the added
extension.
* exp_util.adb (Insert_Actions): Add support for N_External_Initializer
nodes.
* fe.h (C_Source_Buffer): New function.
* gen_il-fields.ads: Add new field.
* gen_il-gen-gen_nodes.adb: Add N_External_Initializer node kind.
* gen_il-gen.adb: Add new field type.
* gen_il-types.ads: Add new node kind and new field type.
* pprint.adb (Expr_Name): Handle new node kind.
* sem.adb (Analyze): Add support for N_External_Initializer nodes.
* sem_ch13.adb (Analyze_Aspect_Specifications, Check_Aspect_At_Freeze_Point):
Add support for External_Initialization aspect.
* sem_ch3.adb (Apply_External_Initialization): New subprogram.
(Analyze_Object_Declaration): Add support for External_Initialization aspect.
* sem_res.adb (Resolve_External_Initializer): New procedure.
(Resolve): Add support for N_External_Initializer nodes.
(Set_String_Literal_Subtype): Extend to handle N_External_Initializer nodes.
* sinfo-utils.adb (Is_In_Union_Id): Adapt to new field addition.
* sinfo.ads: Add documentation for new node kind and new field.
* sinput.adb, sinput.ads (C_Source_Buffer): Add new C interface function.
* snames.ads-tmpl: Add new aspect identifier.
* sprint.adb (Sprint_Node_Actual): Add nop handling of N_External_Initializer
nodes.
* types.ads: Modify type to allow for new C interface.
* gcc-interface/trans.cc (gnat_to_gnu): Handle new GNAT node type.
* gcc-interface/Make-lang.in: Update list of stage1 run-time library units.
* gnat-style.texi: Regenerate.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2024-10-08 Olivier Hainque <hainque@adacore.com>
* Makefile.rtl (arm/aarch64-android): Associate a-nallfl.ads with
libgnat/a-nallfl__wraplf.ads.
2024-10-08 Olivier Hainque <hainque@adacore.com>
* libgnarl/s-linux__android-arm.ads: Define SIGSYS.
* libgnarl/s-linux__android-aarch64.ads: Define SIGSYS.
* libgnarl/s-osinte__android.ads: Expose SIGSYS value.
2024-10-08 Olivier Hainque <hainque@adacore.com>
* libgnarl/s-linux__android-arm.ads: New file, renaming of ...
* libgnarl/s-linux__android.ads: ... this file.
* libgnarl/s-linux__android-aarch64.ads: New file. Based on the
-arm variant, with sa_ field positions adjusted.
* Makefile.rtl (arm/aarch64-android pairs): Adjust accordingly.
* libgnarl/s-osinte__android.ads: Rather than making assumptions
on the actual type of the C sigset_t, use
Os_Constants.SIZEOF_sigset_t to define an Ada sigset_t type of the
proper size. Use C.int instead of unsigned_long for sa_flags.
2024-10-08 Olivier Hainque <hainque@adacore.com>
* init.c (__gnat_error_handler): Map signals straight to Ada
exceptions, without a local CFI trampoline.
(__gnat_adjust_context_for_raise): Guard arm specific code on __arm__
compilation. Do nothing otherwise, relying on libgcc's signal
frame recognition for PC/RA adjustments.
2024-10-08 Olivier Hainque <hainque@adacore.com>
* Makefile.rtl: Extend arm-android section to aarch64, in a similar
fashion as other arm/arch64 configurations. Introduce pair
selection guards to prevent match of aarch64-linux-android on the
regular aarch64-linux% cross as well.
2024-10-08 Ghjuvan Lacambre <lacambre@adacore.com>
* sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Turn
Compile_Time pragmas into null nodes
2024-10-05 Eric Botcazou <ebotcazou@adacore.com>
PR middle-end/116933
* gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Out_Parameter>: Add
the "uninitialized" attribute on Out parameters.
* gcc-interface/utils.cc (gnat_internal_attributes): Add entry for
the "uninitialized" attribute.
(handle_uninitialized_attribute): New function.
2024-09-25 Mikael Morin <mikael@gcc.gnu.org>
PR other/116801
* gcc-interface/lang.opt.urls: Regenerate.
2024-09-10 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/misc.cc: Include memmodel.h before tm_p.h.
2024-09-10 Viljar Indus <indus@adacore.com>
* gcc-interface/decl.cc: Use same warning characters in
continuation messages.
* gcc-interface/trans.cc: Likewise.
2024-09-10 Javier Miranda <miranda@adacore.com>
* sem_ch13.adb (Analyze_One_Aspect): Call
Error_Msg_GNAT_Extension() to report an error when the aspect
First_Controlling_Parameter is set to True and the sources are
compiled without Core_Extensions_ Allowed.
* sem_prag.adb (Pragma_First_Controlling_Parameter): Call
subprogram Error_Msg_GNAT_Extension() to report an error when the
aspect First_Controlling_Parameter is set to True and the sources
are compiled without Core_Extensions_Allowed. Report an error when
the aspect pragma does not confirm an inherited True value.
2024-09-10 Viljar Indus <indus@adacore.com>
* diagnostics-pretty_emitter.adb (Get_Last_Line_Char): New. Get
the last non line change character. Write_Span_Labels use the
adjusted line end pointer to calculate the length of the span.
2024-09-10 Piotr Trojanek <trojanek@adacore.com>
* exp_intr.ads, exp_intr.adb (Expand_Source_Info): Move
declaration to package spec.
* sem_eval.adb (Eval_Intrinsic_Call): Evaluate calls to
GNAT.Source_Info where possible.
2024-09-10 Piotr Trojanek <trojanek@adacore.com>
* checks.adb (Remove_Checks): Combine CASE alternatives.
2024-09-10 Piotr Trojanek <trojanek@adacore.com>
* libgnat/s-os_lib.ads: Remove extra whitespace.
2024-09-09 David Malcolm <dmalcolm@redhat.com>
PR other/116613
* gcc-interface/misc.cc (internal_error_function): Rename
diagnostic_context's "printer" field to "m_printer".
2024-09-05 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.cc (addressable_p) <COMPONENT_REF>: Add bypass
for internal fields on strict-alignment platforms.
2024-09-05 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/gigi.h (default_field_alignment): New function.
* gcc-interface/misc.cc: Include tm_p header file.
(default_field_alignment): New function.
* gcc-interface/trans.cc (addressable_p) <COMPONENT_REF>: Replace
previous alignment klduge with call to default_field_alignment.
* gcc-interface/utils.cc (finish_record_type): Likewise for the
alignment based on which DECL_BIT_FIELD should be cleared.
2024-09-05 Piotr Trojanek <trojanek@adacore.com>
* exp_util.ads, exp_util.adb (Duplicate_Subexpr_No_Checks):
Remove parameters, which are no longer used.
2024-09-05 Viljar Indus <indus@adacore.com>
* par-endh.adb: add call to new diagnostic for end loop errors.
* sem_ch13.adb: add call to new diagnostic for default iterator
error and record representation being too late.
* sem_ch4.adb: Add new diagnostic for wrong operands.
* sem_ch9.adb: Add new diagnostic for a Lock_Free warning.
* libgnat/g-lists.adb (Ensure_Unlocked): Make checks for tampering
conditional.
* libgnat/g-lists.ads: Add parameter Tampering_Checks to control
whether tampering checks should be executed.
* backend_utils.adb: Add new gcc switches
'-fdiagnostics-format=sarif-file' and
'-fdiagnostics-format=sarif-stderr'.
* debug.adb: document -gnatd_D switch.
* diagnostics-brief_emitter.adb: New package for displaying
diagnostic messages in a compact manner.
* diagnostics-brief_emitter.ads: Same as above.
* diagnostics-constructors.adb: New pacakge for providing simpler
constructor methods for new diagnostic objects.
* diagnostics-constructors.ads: Same as above.
* diagnostics-converter.adb: New package for converting old
Error_Msg_Object-s to Diagnostic_Types.
* diagnostics-converter.ads: Same as above.
* diagnostics-json_utils.adb: Package for utility methods related
to emitting JSON.
* diagnostics-json_utils.ads: Same as above.
* diagnostics-pretty_emitter.adb: New package for displaying
diagnostic messages in a more elaborate manner.
* diagnostics-pretty_emitter.ads: Same as above.
* diagnostics-repository.adb: New package for collecting all
created error messages.
* diagnostics-repository.ads: Same as above.
* diagnostics-sarif_emitter.adb: New pacakge for converting all of
the diagnostics into a report in the SARIF format.
* diagnostics-sarif_emitter.ads: Same as above.
* diagnostics-switch_repository.adb: New package containing the
definitions for all of the warninging switches.
* diagnostics-switch_repository.ads: Same as above.
* diagnostics-utils.adb: Contains various utility methods for the
diagnostic pacakges.
* diagnostics-utils.ads: Same as above.
* diagnostics.adb: Contains the definitions and common functions
for all the new diagnostics objects.
* diagnostics.ads: Same as above.
* errout.adb: Relocate the old implementations for brief and
pretty printing the diagnostic messages and the entrypoint to the
new implementation if a debug switch is used.
* errout.ads: Improve documentation. Make Set_Msg_Text publicly
available.
* opt.ads: Add the flag SARIF_File which controls whether the
diagnostic messages should be printed to a file in the SARIF
format. Add the flag SARIF_Output to control whether the
diagnostic messages should be printed to std-err in the SARIF
format.
* gcc-interface/Make-lang.in: Add new pacakages to the object
list.
* gcc-interface/Makefile.in: Add new pacakages to the object list.
2024-09-05 Jose Ruiz <ruiz@adacore.com>
* ali-util.adb (Get_File_Checksum): Force the parsing for
the checksum computation of runtime files to be done in
the corresponding recent Ada version.
2024-09-05 Ronan Desplanques <desplanques@adacore.com>
* inline.adb (Cannot_Inline): Remove assertion.
* inline.ads (Cannot_Inline): Add precondition.
2024-09-03 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.cc (addressable_p) <COMPONENT_REF>: Add kludge
to cope with ancient 32-bit ABIs.
2024-09-03 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.cc (create_temporary): Deal with types whose
size is self-referential by allocating the maximum size.
2024-09-03 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.cc (get_atomic_access): Deal specifically with
nodes that are both Atomic and Volatile_Full_Access in Ada 2012.
2024-09-03 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.cc (addressable_p) <COMPONENT_REF>: Take into
account the alignment of the field on all platforms.
2024-09-03 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.cc (gnat_to_gnu_field): Clear again gnu_size
after updating it if it is not constant.
2024-09-03 Marc Poulhiès <poulhies@adacore.com>
* exp_unst.adb (Check_Static_Type::Note_Uplevel_Bound): Refactor
to use the generic Traverse_Proc.
(Check_Static_Type): Adjust calls to Note_Uplevel_Bound as the
previous second parameter was unused, so removed.
2024-09-03 Steve Baird <baird@adacore.com>
* exp_attr.adb (Expand_N_Attribute_Reference): If it makes sense
to do so, then rewrite a Length attribute reference as an
equivalent conditional expression.
2024-09-03 Eric Botcazou <ebotcazou@adacore.com>
* sem_res.adb (Is_Atomic_Ref_With_Address): Rename into...
(Is_Atomic_Non_VFA_Ref_With_Address): ...this and adjust the
implementation to exclude Volatile_Full_Access objects.
(Resolve_Indexed_Component): Adjust to above renaming.
(Resolve_Selected_Component): Likewise.
2024-09-03 Steve Baird <baird@adacore.com>
* sem_aggr.adb (Resolve_Array_Aggregate): Implement the two new
legality rules of AI11-0106. Add code to avoid cascading error
messages.
2024-09-03 Bob Duff <duff@adacore.com>
* exp_ch6.adb (Add_Collection_Actual_To_Build_In_Place_Call):
Remove Finalize_Storage_Only from the code that checks whether to
pass null to the Collection parameter. Having done that, we don't
need to check for Is_Library_Level_Entity, because
No_Heap_Finalization requires that. And if we ever change
No_Heap_Finalization to allow nested access types, we will still
want to pass null. Note that the comment "Such a type lacks a
collection." is incorrect in the case of Finalize_Storage_Only;
such types have a collection.
2024-09-02 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.cc (gnat_to_gnu_entity): Cap the Esize of a
floating-point type to the size of the widest format supported in
hardware if it is explicity defined.
2024-09-02 Viljar Indus <indus@adacore.com>
* doc/gnat_ugn/building_executable_programs_with_gnat.rst: update
documentation for the -gnatw_l switch.
* usage.adb: Add -gnatw_l entry.
* gnat_ugn.texi: Regenerate.
2024-09-02 Ronan Desplanques <desplanques@adacore.com>
* gnatcmd.adb (GNATCmd): Fix standard output stream.
2024-09-02 Ronan Desplanques <desplanques@adacore.com>
* doc/gnat_ugn/building_executable_programs_with_gnat.rst: Fix
minor issues.
* gnat_ugn.texi: Regenerate.
2024-09-02 Bob Duff <duff@adacore.com>
* doc/gnat_rm/gnat_language_extensions.rst: I assume "extended set
of extensions" was a typo for "experimental set of extensions",
because "extended extensions" is repetitive and redundant. "in
addition" clarifies that the one subsumes the other. Add a
reminder at the start of each subsection about what switch/pragma
enables what extensions. Add new section about "Inference of
Dependent Types in Generic Instantiations".
* gnat_rm.texi: Regenerate.
2024-09-02 Patrick Bernardi <bernardi@adacore.com>
* s-oscons-tmplt.c: Define sizes of pthread data types on FreeBSD.
* tracebak.c: Use GCC unwinder and adjust PC appropriately on
aarch64-freebsd.
2024-09-02 Marc Poulhiès <poulhies@adacore.com>
* exp_ch9.adb (Reset_Scopes_To): Adjust comment.
(Reset_Scopes_To.Reset_Scope): Adjust the scope reset for object
declaration. In particular, visit the children nodes if any. Also
extend the handling of other declarations to
N_Implicit_Label_Declaration.
2024-09-02 Piotr Trojanek <trojanek@adacore.com>
* exp_ch3.adb (Expand_N_Object_Declaration): Replace calls to Sloc
with uses of Loc; turn variable Prag into constant.
2024-09-02 Piotr Trojanek <trojanek@adacore.com>
* exp_imgv.adb (Expand_User_Defined_Enumeration_Image)
(Expand_Image_Attribute): Remove redundant guards.
2024-08-29 Eric Botcazou <ebotcazou@adacore.com>
* sem_ch8.adb (Has_Private_With): Add test on Is_Entity_Name.
2024-08-29 Eric Botcazou <ebotcazou@adacore.com>
* checks.adb (Selected_Length_Checks.Get_E_Length): For a
component of a record with discriminants and if the expression is
a selected component, try to build an actual subtype from its
prefix instead of from the discriminal.
2024-08-29 Steve Baird <baird@adacore.com>
* sem_ch6.adb (Check_Discriminant_Conformance): Immediately after
calling Is_Immutably_Limited_Type, perform an additional test that
one might reasonably imagine would instead have been part of
Is_Immutably_Limited_Type. The new test is a call to a new
function Has_Tagged_Limited_Partial_View whose implementation
includes a call to Incomplete_Or_Partial_View, which cannot be
easily be called from Is_Immutably_Limited_Type (because sem_aux,
which is in the closure of the binder, cannot easily "with"
sem_util).
* sem_aux.adb (Is_Immutably_Limited): Include
N_Derived_Type_Definition case when testing Limited_Present flag.
2024-08-29 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch6.adb (Expand_Call_Helper): In the case of a function
call, look at the Etype of the call node to determine whether
finalization actions need to be performed.
2024-08-29 Viljar Indus <indus@adacore.com>
* erroutc.adb (dmsg): Print Insertion_Sloc.
2024-08-29 Viljar Indus <indus@adacore.com>
* exp_aggr.adb (Expand_Range_Component): Remove extra warning
character. Use same conditional warning char.
* freeze.adb (Warn_Overlay): Use named warning character.
* restrict.adb (Id_Case): Use named warning character.
* sem_prag.adb (Rewrite_Assertion_Kind): Use default warning
character.
2024-08-29 Viljar Indus <indus@adacore.com>
* par-ch4.adb (P_Name): Use Error_Msg_Sloc for the location of the
continuation message.
2024-08-29 Viljar Indus <indus@adacore.com>
* exp_prag.adb (Expand_Pragma_Inspection_Point): Improve sub
diagnostic generation.
2024-08-29 Viljar Indus <indus@adacore.com>
* sem_ch12.adb (Abandon_Instantiation): Remove continuation
characters from the error message.
* sem_ch13.adb (Check_False_Aspect_For_Derived_Type): Remove
continuation characters from the error message.
* sem_ch6.adb (Assert_False): Avoid creating a continuation
message without a parent. If no primary message is created then
the message is considered as primary.
2024-08-29 Viljar Indus <indus@adacore.com>
* erroutc.adb (Prescan_Message): Avoid not parsing all of the
message attributes.
* erroutc.ads: Update the documentation.
2024-08-29 Viljar Indus <indus@adacore.com>
* freeze.adb: Remove warning insertion characters from a
continuation message.
* sem_util.adb: Remove warning insertion characters from a
continuation message.
* sem_warn.adb: Use same warning character as the main message.
2024-08-29 Viljar Indus <indus@adacore.com>
* erroutc.ads: Add new method Output_Text_Within
* erroutc.adb: Move the line fitting code to a new method called
Output_Text_Within
2024-08-29 Piotr Trojanek <trojanek@adacore.com>
* checks.adb (Expr_Known_Valid): Use Validated_View, which strips
type derivation and privacy.
* exp_ch3.adb (Simple_Init_Private_Type): Kill checks inside
unchecked conversions, just like in Simple_Init_Scalar_Type.
2024-08-29 Viljar Indus <indus@adacore.com>
* styleg.adb (Check_Line_Max_Length): Add the actual line length
to the diagnostic message.
2024-08-29 Gary Dismukes <dismukes@adacore.com>
* sem_aggr.adb (Resolve_Array_Aggregate): Add loop over associations to locate
N_Iterated_Component_Associations that do not have an Iterator_Specification,
and if their Discrete_Choices list consists of a single choice, analyze it and
if it's the name of an iterator object, then create an Iterator_Specification
and associate it with the iterated component association.
(Resolve_Iterated_Association): Replace test for function call with test of
Is_Object_Reference, to handle other forms of iterator objects in container
aggregates.
2024-08-29 Javier Miranda <miranda@adacore.com>
* usage.adb (Usage): Document switch -gnatw_j
* doc/gnat_rm/gnat_language_extensions.rst: Add documentation.
* gnat_rm.texi: Regenerate.
2024-08-29 Justin Squirek <squirek@adacore.com>
* doc/gnat_rm/gnat_language_extensions.rst: Move conditional when
constructs out of the curated set.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2024-08-23 Robin Dapp <rdapp@ventanamicro.com>
PR middle-end/115495
* gcc-interface/utils2.cc (fast_modulo_reduction): Require mode.
(nonbinary_modular_operation): Ditto.
2024-08-23 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/misc.cc (gnat_get_array_descr_info): Test the
BIT_PACKED_ARRAY_TYPE_P flag only once on the final debug type. In
the case of records containing a template, replay the entire
processing for the array type contained therein.
2024-08-23 Javier Miranda <miranda@adacore.com>
* scng.adb (Scan): Call Error_Msg_GNAT_Extension() to report an
error, when the sources are compiled without Core_Extensions_
Allowed, and the scanner detects the beginning of an interpolated
string.
2024-08-23 Sebastian Poeplau <poeplau@adacore.com>
* libgnat/s-dwalin.adb (Symbolic_Address): Ignore symbol size in
address-to-symbol translation for PECOFF files.
2024-08-23 Javier Miranda <miranda@adacore.com>
* exp_attr.adb (Expand_N_Attribute_Reference: [Put_Image]): Add
support for custom string types.
* exp_ch2.adb (Expand_N_Interpolated_String_Literal): Add a type
conversion to the result object declaration of custom string
types.
* exp_put_image.adb (Build_String_Put_Image_Call): Handle custom
string types.
2024-08-23 Steve Baird <baird@adacore.com>
* sem_ch13.adb (Analyze_Aspect_Implicit_Dereference): Generate
error if an aspect specification specifies the
Implicit_Dereference aspect of a non-first subtype.
2024-08-23 Steve Baird <baird@adacore.com>
* checks.adb (Is_Signed_Integer_Arithmetic_Op): Return True in the
case of relational operator whose operands are of a signed integer
type.
2024-08-23 Viljar Indus <indus@adacore.com>
* libgnat/a-coinho__shared.ads: add limited keyword.
* libgnat/g-awk.adb: add limited keyword.
* libgnat/g-comlin.ads: add limited keyword.
* libgnat/s-excmac__arm.ads: add limited keyword.
* libgnat/s-excmac__gcc.ads: add limited keyword.
* libgnat/s-soflin.ads: add limited keyword.
2024-08-23 Viljar Indus <indus@adacore.com>
* sem_ch3.adb: Add method Check_Inherited_Limted_Record for
emitting the warning for an inherited limited type.
* warnsw.adb: Add processing for the -gnatw_l switch that
triggeres the inheritly limited type warning.
* warnsw.ads: same as above.
* doc/gnat_ugn/building_executable_programs_with_gnat.rst: Add
entry for -gnatw_l switch.
* gnat_ugn.texi: Regenerate.
2024-08-23 Javier Miranda <miranda@adacore.com>
* sem_ch6.adb (Check_Private_Overriding): Improve code detecting
error on private function with controlling result. Fixes the
regression of ACATS bde0003.
2024-08-23 Piotr Trojanek <trojanek@adacore.com>
* checks.ads, cstand.adb, exp_aggr.adb, exp_ch4.adb, exp_ch5.adb,
exp_dbug.adb, exp_util.adb, gnatlink.adb, lib-util.adb,
libgnat/a-except.adb, libgnat/a-exexpr.adb, libgnat/a-ngcoar.adb,
libgnat/s-rannum.adb, libgnat/s-trasym__dwarf.adb, osint.adb,
rtsfind.adb, sem_case.adb, sem_ch12.adb, sem_ch13.adb,
sem_ch3.adb, sem_ch6.adb, sem_eval.adb, sem_prag.adb,
sem_util.adb: Fix style.
2024-08-23 Piotr Trojanek <trojanek@adacore.com>
* checks.adb (Ensure_Valid): Remove detection of boolean and
short-circuit operators.
(Expr_Known_Valid): Detect short-circuit operators; detection of
boolean operators was already done in this routine.
2024-08-23 Piotr Trojanek <trojanek@adacore.com>
* checks.adb (Ensure_Valid): Use Find_Actual.
2024-08-23 Piotr Trojanek <trojanek@adacore.com>
* checks.adb (Ensure_Valid): Use First_Actual/Next_Actual.
* exp_ch6.adb (Is_Direct_Deep_Call): Likewise.
* exp_util.adb (Type_Of_Formal): Likewise.
* sem_util.adb (Is_Container_Element): Likewise; cleanup
membership test by using a subtype.
2024-08-23 Javier Miranda <miranda@adacore.com>
* sem_ch13.adb (Analyze_One_Aspect): Temporarily remove reporting
an error when the new aspect is set to True and the extensions are
not enabled.
2024-08-23 Javier Miranda <miranda@adacore.com>
* exp_util.ads (Is_Expanded_Class_Wide_Interface_Object_Decl): New
subprogram.
* exp_util.adb (Is_Expanded_Class_Wide_Interface_Object_Decl):
ditto.
* sem_util.adb (Is_Aliased_View): Handle expanded class-wide type
object declaration.
* checks.adb (Is_Aliased_Unconstrained_Component): Protect the
frontend against calling Is_Aliased_View with Empty. Found working
on this issue.
2024-08-23 Javier Miranda <miranda@adacore.com>
* aspects.ads (Aspect_First_Controlling_Parameter): New aspect.
Defined as implementation defined aspect that has a static boolean
value and it is converted to pragma when the value is True.
* einfo.ads (Has_First_Controlling_Parameter): New attribute.
* exp_ch9.adb (Build_Corresponding_Record): Propagate the aspect
to the corresponding record type.
(Expand_N_Protected_Type_Declaration): Analyze the inherited
aspect to add the pragma.
(Expand_N_Task_Type_Declaration): ditto.
* freeze.adb (Warn_If_Implicitly_Inherited_Aspects): New
subprogram.
(Has_First_Ctrl_Param_Aspect): New subprogram.
(Freeze_Record_Type): Call Warn_If_Implicitly_Inherited_Aspects.
(Freeze_Subprogram): Check illegal subprograms of tagged types and
interface types that have this new aspect.
* gen_il-fields.ads (Has_First_Controlling_Parameter): New entity
field.
* gen_il-gen-gen_entities.adb (Has_First_Controlling_Parameter):
The new field is a semantic flag.
* gen_il-internals.adb (Image): Add
Has_First_Controlling_Parameter.
* par-prag.adb (Prag): No action for
Pragma_First_Controlling_Parameter since processing is handled
entirely in Sem_Prag.
* sem_ch12.adb (Validate_Private_Type_Instance): When the generic
formal has this new aspect, check that the actual type also has
this aspect.
* sem_ch13.adb (Analyze_One_Aspect): Check that the aspect is
applied to a tagged type or a concurrent type.
* sem_ch3.adb (Analyze_Full_Type_Declaration): Derived tagged
types inherit this new aspect, and also from their implemented
interface types.
(Process_Full_View): Propagate the aspect to the full view.
* sem_ch6.adb (Is_A_Primitive): New subprogram; used to factor
code and also clarify detection of primitives.
* sem_ch9.adb (Check_Interfaces): Propagate this new aspect to the
type implementing interface types.
* sem_disp.adb (Check_Controlling_Formals): Handle tagged type
that has the aspect and has subprograms overriding primitives of
tagged types that lack this aspect.
(Check_Dispatching_Operation): Warn on dispatching primitives
disallowed by this new aspect.
(Has_Predefined_Dispatching_Operation_Name): New subprogram.
(Find_Dispatching_Type): Handle dispatching functions of tagged
types that have the new aspect.
(Find_Primitive_Covering_Interface): For primitives of tagged
types that have the aspect and override a primitive of a parent
type that does not have the aspect, we must temporarily unset
attribute First_Controlling_ Parameter to properly check
conformance.
* sem_prag.ads (Aspect_Specifying_Pragma): Add new pragma.
* sem_prag.adb (Pragma_First_Controlling_Parameter): Handle new
pragma.
* snames.ads-tmpl (Name_First_Controlling_Parameter): New name.
* warnsw.ads (Warn_On_Non_Dispatching_Primitives): New warning.
* warnsw.adb (Warn_On_Non_Dispatching_Primitives): New warning;
not set by default when GNAT_Mode warnings are enabled, nor when
all warnings are enabled (-gnatwa).
2024-08-19 Arsen Arsenović <arsen@aarsen.me>
PR ada/115917
* gnatvsn.ads: Add note about the duplication of this value in
version.c.
* version.c (VER_LEN_MAX): Define to the same value as
Gnatvsn.Ver_Len_Max.
(gnat_version_string): Use VER_LEN_MAX as bound.
2024-08-08 Steve Baird <baird@adacore.com>
* sem_ch6.adb (Check_Discriminant_Conformance): Perform check for
illegal access discriminant default values when the completion of
a limited private type is analyzed.
* sem_aux.adb (Is_Immutably_Limited): If passed the
not-yet-analyzed entity for the full view of a record type, test
the Limited_Present flag
(which is set by the parser).
2024-08-08 Steve Baird <baird@adacore.com>
* exp_ch4.adb (Build_Eq_Call): In the abstract callee case, copy
the Etype of the callee onto the Make_Raise_Program_Error result.
2024-08-08 Gary Dismukes <dismukes@adacore.com>
* exp_ch7.adb (Unnest_Block): Copy the At_End_Proc from the block
statement to the newly created subprogram body.
2024-08-08 Justin Squirek <squirek@adacore.com>
* exp_put_image.adb (Append_Component_Attr): Obtain the mutably
tagged type for the component type.
* mutably_tagged.adb (Make_Mutably_Tagged_Conversion): Add more
cases to avoid conversion generation.
* sem_attr.adb (Check_Put_Image_Attribute): Add mutably tagged
type conversion.
* sem_ch12.adb (Analyze_One_Association): Add rewrite for formal
type declarations which are mutably tagged type to their
equivalent type.
(Instantiate_Type): Add condition to obtain class wide equivalent
types.
(Validate_Private_Type_Instance): Add check for class wide
equivalent types which are considered "definite".
* sem_util.adb (Is_Variable): Add condition to handle selected
components of view conversions. Add missing check for selected
components.
(Is_View_Conversion): Add condition to handle class wide
equivalent types.
2024-08-08 Justin Squirek <squirek@adacore.com>
* stylesw.adb (Set_Style_Check_Options): Disable max nesting level
when unspecified
2024-08-08 Javier Miranda <miranda@adacore.com>
* exp_attr.adb (Expand_N_Attribute_Reference) <Finalization_Size>:
If the prefix is an interface type, generate code to obtain its
address and displace it to reference the base of the object.
2024-08-08 Iain Sandoe <iain@sandoe.co.uk>
* libgnarl/s-taprop__posix.adb (Stack_Guard): Use Interfaces.C.size_t
for the type of Page_Size.
2024-08-08 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* libgnarl/s-taprop__solaris.adb (Set_Task_Affinity): Fully
quality int.
2024-08-06 Yannick Moy <moy@adacore.com>
* sem_ch4.adb (Analyze_Concatenation_Rest): Do not add a wrong
interpretation of the concatenation, using the type of the operand
already recognized as of the element type.
2024-08-06 Bob Duff <duff@adacore.com>
* sem_ch12.adb: Implement type inference for generic parameters.
(Maybe_Infer_One): Forbid inference of anonymous subtypes and
types.
(Inference_Reason): Fix comment.
* debug.adb: Document -gnatd_I switch.
* errout.ads: Document that Empty is not allowed for "&".
* errout.adb (Set_Msg_Insertion_Node): Minor: Do not allow
Error_Msg_Node_1 = Empty for "&". Use "in" instead of multiple
"=". Improve comment.
2024-08-06 Gary Dismukes <dismukes@adacore.com>
* sem_ch5.adb (Analyze_Loop_Statement.Wrap_Loop_Statement): Remove
the loop Entity_Id from its old scope and insert it in the new
block scope that wraps it.
2024-08-06 Javier Miranda <miranda@adacore.com>
* freeze.adb (Freeze_Entity): For scalar derived types that
inherit the aspect Default_Value, do not analyze and resolve the
inherited aspect, as the type of the aspect remains the parent
type.
2024-08-06 Viljar Indus <indus@adacore.com>
* libgnarl/s-interr__hwint.adb: Use fully qualified names to avoid
ambiguity.
* libgnarl/s-taprop__qnx.adb: Likewise.
2024-08-06 Javier Miranda <miranda@adacore.com>
* repinfo.adb (List_Record_Info): Handle private record types.
2024-08-06 Viljar Indus <indus@adacore.com>
* libgnarl/s-taprop__mingw.adb: Use fully qualified names
to avoid ambiguity.
* libgnarl/s-taprop__posix.adb: Likewise.
* libgnarl/s-taprop__qnx.adb: Likewise.
* libgnarl/s-taprop__rtems.adb: Likewise.
2024-08-06 Yannick Moy <moy@adacore.com>
* freeze.adb (Build_Renamed_Body): Propagate SPARK_Pragma to body
build from renaming, so that locally relevant value is taken into
account.
* sem_ch6.adb (Analyze_Expression_Function): Propagate
SPARK_Pragma to body built from expression function, so that
locally relevant value is taken into account.
2024-08-06 Bob Duff <duff@adacore.com>
* sem_ch8.adb (Find_Direct_Name): Disable the special-purpose code
when we are actually compiling the run-time library itself.
* libgnarl/a-exetim__posix.adb: Fix newly-found use-clause
conflicts.
* libgnat/a-direct.adb: Likewise.
* libgnat/a-nbnbin.adb: Likewise.
* libgnat/a-timoio__128.adb: Likewise.
* libgnat/a-timoio.adb: Likewise.
* libgnat/a-wtmoio__128.adb: Likewise.
* libgnat/a-wtmoio.adb: Likewise.
* libgnat/a-ztmoio__128.adb: Likewise.
* libgnat/a-ztmoio.adb: Likewise.
2024-08-02 Yannick Moy <moy@adacore.com>
* aspects.adb (Find_Aspect): Take into account the case of a node
of kind N_Defining_Program_Unit_Name.
* sem_ch10.adb (Analyze_Compilation_Unit): Copy the SPARK aspect
from the spec to the body. Delay semantic analysis after that
point to ensure that SPARK_Mode is properly analyzed.
2024-08-02 Piotr Trojanek <trojanek@adacore.com>
* exp_aggr.adb (Add_Loop_Actions): Actions are now attached to
iterated component association just like they are attached to
ordinary component association.
(Build_Array_Aggr_Code): If resolution of the array aggregate
generated some actions, e.g. for run-time checks, then we must
keep them; same for the Other_Clause.
* sem_aggr.adb (Resolve_Iterated_Component_Association): Unset
references to iterator variable in loop actions (which might come
from run-time check), just these references are unset in the
expression itself.
2024-08-02 Piotr Trojanek <trojanek@adacore.com>
* exp_util.adb (Insert_Actions): Remove null ELSE branch.
2024-08-02 Piotr Trojanek <trojanek@adacore.com>
* exp_aggr.adb (Add_Loop_Actions): Change manipulation of list
to avoid unnecessary calls to Parent and Loop_Actions.
2024-08-02 Piotr Trojanek <trojanek@adacore.com>
* exp_util.adb (Insert_Actions): Move negation in front of
complex conjunctions.
2024-08-02 Piotr Trojanek <trojanek@adacore.com>
* exp_aggr.adb (Gen_Assign): Fix layout.
* sem_aggr.adb (Empty_Range): Reuse Choice_List.
2024-08-02 Gary Dismukes <dismukes@adacore.com>
* exp_aggr.adb
(Expand_Container_Aggregate.Expand_Iterated_Component): Set the
Reverse_Present flag when creating the loop's iteration_scheme.
* gen_il-gen-gen_nodes.adb: Add flag Reverse_Present to
N_Iterated_Component_Association nodes.
* par-ch3.adb (P_Constraint_Op): Remove testing for and ignoring
of Tok_In following a constraint. It's allowed for "in" to follow
a constraint of loop_parameter_subtype_indication of an
iterator_specification, so it shouldn't be ignored.
* par-ch4.adb (P_Iterated_Component_Association): Account for
"reverse" following the "in" in an iterated_component_association,
and set the Reverse_Present flag on the
N_Iterated_Component_Association node. Add handling for a ":"
following the identifier in an iterator_specification of an
iterated_element_association, sharing the code with the "of" case
(which backs up to the identifier at the beginning of the
iterator_specification). Fix incorrect trailing comment following
the call to Scan.
(Build_Iterated_Element_Association): Set the Reverse_Present flag
on an N_Loop_Parameter_Specification node of an
N_Iterated_Element_Association.
* par-ch5.adb (P_Iterator_Specification): Remove error-recovery
and error code that reports "subtype indication is only legal on
an element iterator", as that error can no longer be emitted (and
was formerly only reported on one fixedbugs test).
* sem_aggr.adb
(Resolve_Container_Aggregate.Resolve_Iterated_Association): When
creating an N_Iterator_Specification for an
N_Iterated_Component_Association, set the Reverse_Present flag of
the N_Iterated_Specification from the flag on the latter.
* sinfo.ads: Add comments for the Reverse_Present flag, which is
now allowed on nodes of kind N_Iterated_Component_Association.
2024-08-02 Eric Botcazou <ebotcazou@adacore.com>
* sem_ch12.adb (Analyze_Subprogram_Instantiation): Propagate the
No_Raise flag like the No_Return flag.
2024-08-02 Ronan Desplanques <desplanques@adacore.com>
* exp_aggr.adb (Expand_Container_Aggregate): Remove variables.
(To_Int): New function.
(Add_Range_Size): Use newly introduced function.
2024-08-02 Yannick Moy <moy@adacore.com>
* libgnat/a-strunb.adb (Sum, Saturated_Sum, Saturated_Mul): Adapt
function signatures to more precise types that allow proof.
(function "&"): Conditionally assign a slice to avoid possible
overflow which only occurs when the assignment is a noop (because
the slice is empty in that case).
(Append): Same.
(function "*"): Retype K to avoid a possible overflow. Add early
return on null length for proof.
(Delete): Fix implementation to return the correct result in all
cases allowed by the Ada standard.
(Insert): Same. Also avoid possible overflows.
(Length): Rewrite as expression function for proof.
(Overwrite): Avoid possible overflows.
(Slice): Same.
(To_String): Rewrite as expression function for proof.
* libgnat/a-strunb.ads: Extend Assertion_Policy to new contracts
used. Add complete functional contracts to all subprograms of the
public API except Count.
* libgnat/a-strunb__shared.adb (Sum): Adapt function signature to
more precise types that allow proof.
(function "&"): Conditionally assign a slice to avoid possible
overflow.
(function "*"): Retype K to avoid a possible overflow.
(Delete): Fix implementation to return the correct result in all
cases allowed by the Ada standard.
(Insert): Avoid possible overflows.
(Overwrite): Avoid possible overflows.
(Replace_Slice): Same.
(Slice): Same.
(To_String): Rewrite as expression function for proof.
* libgnat/a-strunb__shared.ads: Extend Assertion_Policy to new
contracts used. Add complete functional contracts to all
subprograms of the public API except Count. Mark public part of
spec as in SPARK.
2024-08-02 Ronan Desplanques <desplanques@adacore.com>
* scng.adb (Slit): Initialize object in uncommon path.
2024-08-02 Richard Kenner <kenner@adacore.com>
* exp_ch4.adb (Generate_Temporary): Remove unused procedure.
2024-08-02 Richard Kenner <kenner@adacore.com>
* einfo-utils.ads (Is_Finalizer): Delete.
* einfo-utils.adb (Is_Finalizer): Delete.
* einfo.ads: Adjust comment.
* gen_il-fields.ads, gen_il-gen-gen_entities.adb: Add Is_Finalizer
flag.
* exp_ch3.adb (Build_Init_Procedure): Set it.
* exp_ch7.adb (Create_Finalizer): Likewise.
* exp_util.adb (Try_Inline_Always): New function.
* exp_util.ads (Try_Inline_Always): New function.
* sem_elab.adb (Is_Finalizer_Proc): Replace with Is_Finalizer.
2024-08-02 Tonu Naks <naks@adacore.com>
* libgnat/a-calend.adb: Modify unix time handling.
2024-08-02 Tonu Naks <naks@adacore.com>
* doc/gnat_rm/implementation_defined_pragmas.rst: Add examples.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2024-08-02 Javier Miranda <miranda@adacore.com>
* gen_il-fields.ads (Is_Interpolated_String_Literal): New field.
* gen_il-gen-gen_nodes.adb (Is_Interpolated_String_Literal): The
new field is a flag handled by the parser (syntax flag).
* par-ch2.adb (P_Interpolated_String_Literal): Decorate the new
flag.
* sem_ch2.adb (Analyze_Interpolated_String_Literal): Improve code
detecting and reporting ambiguous function calls.
* sem_res.adb (Resolve_Interpolated_String_Literal): Restrict
resolution imposed by the context type to string literals that
have the new flag.
* sinfo.ads (Is_Interpolated_String_Literal): New field defined in
string literals. Fix documentation of the syntax rule of
interpolated string literal.
2024-08-02 Steve Baird <baird@adacore.com>
* sem_ch5.adb (Analyze_Assignment): Delete code that was
incorrectly implementing a preference rule.
2024-08-02 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch7.adb (Relaxed Finalization): New paragraph in head
comment.
* sem_ch13.adb (Validate_Finalizable_Aspect): Give an error
message if strict finalization is required but not supported by
the runtime.
2024-08-02 Viljar Indus <indus@adacore.com>
* sem_util.adb (Set_Referenced_Modified): Set referenced as LHS
for the prefixes of array slices.
2024-08-02 Steve Baird <baird@adacore.com>
* sem_ch8.adb (Find_Type): If Is_Current_Instance returns True for
N (and Comes_From_Source (N) is also True) then flag an error.
Call Is_Current_Instance (twice) instead of duplicating (twice)
N_Access_Definition-related code in Is_Current_Instance.
* sem_util.adb (Is_Current_Instance): Implement
access-type-related clauses of the RM 8.6 current instance rule.
For pragmas Predicate and Predicate_Failure, distinguish between
the first and subsequent pragma arguments.
2024-08-02 Steve Baird <baird@adacore.com>
* sem_res.adb (Valid_Conversion): Test In_Instance instead of
In_Instance_Body.
2024-08-02 Eric Botcazou <ebotcazou@adacore.com>
* aspects.ads (Aspect_Id): Add Aspect_No_Raise identifier.
(Implementation_Defined_Aspect): Add True for Aspect_No_Raise.
(Is_Representation_Aspect): Add False for Aspect_No_Raise.
(Aspect_Names): Add Name_No_Raise for Aspect_No_Raise.
(Aspect_Delay): Add Always_Delay for Aspect_No_Raise.
* checks.ads (Raise_Checks_Suppressed): New function.
(Apply_Raise_Check): New procedure.
* checks.adb (Apply_Raise_Check): New procedure.
(Raise_Checks_Suppressed): New function.
* doc/gnat_rm/gnat_language_extensions.rst (Generalized
Finalization): Update.
* doc/gnat_rm/implementation_defined_aspects.rst (No_Raise): New.
* doc/gnat_rm/implementation_defined_characteristics.rst (Check
names): Document Raise_Check and alphabetize others.
* doc/gnat_rm/implementation_defined_pragmas.rst (No_Raise): New.
* einfo.ads (No_Raise): New flag defined in subprograms and
generic subprograms.
* exp_ch6.adb (Expand_N_Subprogram_Body): Call Apply_Raise_Check
at the end of the processing.
* exp_ch11.adb (Get_RT_Exception_Name): Add alternative for
PE_Raise_Check_Failed to case statement.
* gen_il-fields.ads (Opt_Field_Enum): Add No_Raise identifier.
* gen_il-gen-gen_entities.adb (Subprogram_Kind): Add No_Raise as
semantical flag.
(Generic_Subprogram_Kind): Likewise.
* par-prag.adb (Prag): Add alternative for Pragma_No_Raise to case
statement.
* sem_ch13.adb (Validate_Finalizable_Aspect): Set No_Raise on the
Adjust and Finalize primitives if Relaxed_Finalization is set.
* sem_prag.adb (Analyze_Pragma): Add alternative for
Pragma_No_Raise to case statement.
(Sig_Flag): Add 0 for Pragma_No_Raise.
* snames.ads-tmpl (Remaining pragma names): Add Name_No_Raise.
(Names of recognized checks): Add Name_Raise_Check.
(Pragma_Id): Add Pragma_No_Raise identifier.
* types.ads (Raise_Check): New named number.
(All_Checks): Adjust.
(RT_Exception_Code): Add PE_Raise_Check_Failed identifier.
(Rkind): Add PE_Reason for PE_Raise_Check_Failed and alphabetize.
* types.h (RT_Exception_Code): Add PE_Raise_Check_Failed as 38.
(LAST_REASON_CODE): Adjust.
* libgnat/a-except.adb (Rcheck_PE_Raise_Check): New procedure with
pragmas Export, No_Return and Machine_Attributes.
(Rmsg_38): New string constant.
* gnat_rm.texi: Regenerate.
2024-08-02 Johannes Kliemann <kliemann@adacore.com>
* doc/gnat_rm/standard_library_routines.rst: Add note to section
of Ada.Numerics.Discrete_Random and Ada.Numerics.Float_Random.
* doc/gnat_rm/the_gnat_library.rst: Add note to section about
GNAT.Random_Numbers.
* libgnat/a-nudira.ads: Add note about cryptographic properties.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2024-08-02 Ronan Desplanques <desplanques@adacore.com>
* doc/gnat_rm/gnat_language_extensions.rst: Fix layout of section.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2024-08-02 Eric Botcazou <ebotcazou@adacore.com>
* exp_util.ads (Is_Conversion_Or_Reference_To_Formal): New
function declaration.
* exp_util.adb (Is_Conversion_Or_Reference_To_Formal): New
function body.
* exp_ch6.adb (Expand_Simple_Function_Return): Call the predicate
Is_Conversion_Or_Reference_To_Formal in order to decide whether a
tag check or reassignment is needed.
* freeze.adb (Should_Freeze_Type): Move declaration and body to
the appropriate places. Also return True for tagged results
subject to the expansion done in Expand_Simple_Function_Return
that is guarded by the predicate
Is_Conversion_Or_Reference_To_Formal.
2024-08-02 Ronan Desplanques <desplanques@adacore.com>
* sem_ch5.adb (Analyze_Loop_Statement): Fix loop pattern detection
code. Fix typo.
2024-08-01 Yannick Moy <moy@adacore.com>
* libgnat/a-strunb.adb (Realloc_For_Chunk): Fix computation of new
size.
2024-08-01 Yannick Moy <moy@adacore.com>
* libgnat/a-strbou.ads (To_String): Add a postcondition to state
the value of bounds of the returned string, which helps with proof
of callers.
* libgnat/a-strfix.adb (Delete): Fix implementation to produce
correct result in all cases. For example, returned string should
always have a lower bound of 1, which was not respected in one
case. This was not detected by proof, since this code was dead
according to the too strict precondition.
* libgnat/a-strfix.ads (Delete): State the correct precondition
from standard which allows a value of Through beyond the last
valid index, and also restricts values of From from below. Update
the Contract_Cases accordingly to allow new values of parameters.
2024-08-01 Piotr Trojanek <trojanek@adacore.com>
* sem_prag.adb (Analyze_Pragma): Don't check for duplicate
SPARK_Mode pragmas in configuration files.
2024-08-01 Gary Dismukes <dismukes@adacore.com>
* sem_attr.adb (Resolve_Attribute, Attribute_*Access): Resolve
overloaded prefixes that denote objects of reference types,
determining whether to use the prefix object directly, or expand
it as an explicit dereference.
2024-08-01 Eric Botcazou <ebotcazou@adacore.com>
* sinfo.ads (N_Block_Statement): Move At_End_Proc to the end of
slot list and alphabetize flag list.
(N_Subprogram_Body): Add At_End_Proc.
(N_Package_Body): Move At_End_Proc to the end of slot list.
(N_Subprogram_Body_Stub): Remove At_End_Proc.
2024-08-01 Piotr Trojanek <trojanek@adacore.com>
* sem_ch5.adb (Analyze_Loop_Parameter_Specification):
Unconditionally set the type of loop parameter.
2024-08-01 Ghjuvan Lacambre <lacambre@adacore.com>
* backend_utils.adb (Scan_Common_Back_End_Switch): Remove blank
line.
* errout.adb (Output_JSON_Message): Likewise.
* erroutc.adb (Set_Msg_Char): Likewise.
* exp_aggr.adb (Two_Dim_Packed_Array_Handled): Likewise.
* exp_pakd.adb (Expand_Packed_Address_Reference): Likewise.
(Expand_Packed_Bit_Reference): Likewise.
(Expand_Packed_Boolean_Operator): Likewise.
(Expand_Packed_Element_Reference): Likewise.
(Expand_Packed_Eq): Likewise.
(Expand_Packed_Not): Likewise.
* exp_prag.adb (Build_Dim3_Declaration): Likewise.
* exp_strm.adb (Build_Elementary_Input_Call): Likewise.
* freeze.adb (Find_Aspect_No_Parts): Likewise.
(Get_Aspect_No_Parts_Value): Likewise.
* gen_il-gen.adb (Compile): Likewise.
* gnat1drv.adb (Adjust_Global_Switches): Likewise.
* gnat_cuda.adb (Expand_CUDA_Package): Likewise.
* gnatchop.adb (Read_File): Likewise.
* gnatls.adb (Get_Runtime_Path): Likewise.
* make.adb (Binding_Phase): Likewise.
* par-ch11.adb (P_Exception_Choice): Likewise.
* par-ch5.adb (P_Loop_Parameter_Specification): Likewise.
* par-ch6.adb (Is_Extended): Likewise.
* sem_attr.adb (Check_Dereference): Likewise.
* sem_ch12.adb (Build_Subprogram_Decl_Wrapper): Likewise.
* sem_ch3.adb (Build_Itype_Reference): Likewise.
* sem_prag.adb (Validate_Compile_Time_Warning_Errors): Likewise.
* sem_res.adb (Resolve_Declare_Expression): Likewise.
* sem_util.adb (Build_Default_Subtype): Likewise.
* sprint.adb (Sprint_Paren_Comma_List): Likewise.
2024-08-01 Javier Miranda <miranda@adacore.com>
* par-ch2.adb (P_Interpolated_String_Literal): remove support of
multi-line string literals.
* doc/gnat_rm/gnat_language_extensions.rst: Update documentation.
* gnat_rm.texi: Regenerate.
2024-08-01 Viljar Indus <indus@adacore.com>
* sem_warn.adb (Output_Obsolescent_Entity_Warnings): use the ?j?
in warning messages.
2024-08-01 Ronan Desplanques <desplanques@adacore.com>
* sem_ch5.adb (Analyze_Loop_Parameter_Specification): Fix test for
expanded quantified expression context.
(Is_Expanded_Quantified_Expr): New function.
2024-08-01 Bob Duff <duff@adacore.com>
* sem_ch13.adb (Add_Predicate): Remove the premature "return;".
Ghost code needs to be processed by later code in this procedure
even when ignored; otherwise the second pass of name resolution
fails much later. However, protect Set_SCO_Pragma_Enabled and
Add_Condition with "if not Is_Ignored_Ghost_Pragma"; these parts
should not happen if the ghost code is Ignored.
* libgnat/interfac__2020.ads (Unsigned_8): Minor reformatting.
* libgnat/interfac.ads (IEEE_Extended_Float): Minor comment
improvement.
2024-08-01 Eric Botcazou <ebotcazou@adacore.com>
* einfo.ads (No_Return): Change description and adjust
accordingly.
* gen_il-gen-gen_entities.adb (Entity_Kind): Remove No_Return.
(Subprogram_Kind): Add No_Return.
(Generic_Subprogram_Kind): Likewise.
* sem_ch6.adb (Analyze_Return_Statement): Adjust No_Return test.
2024-08-01 Eric Botcazou <ebotcazou@adacore.com>
* doc/gnat_rm/gnat_language_extensions.rst (Generalized
Finalization): Update status.
* einfo.ads (Has_Relaxed_Finalization): Add more details.
* exp_ch4.adb (Process_Transients_In_Expression): Invoke
Make_Finalize_Call_For_Node instead of building the call.
* exp_ch5.adb (Expand_N_Assignment_Statement): Do not set up an
exception handler around the assignment for a controlled type with
relaxed finalization semantics. Streamline the code implementing
the protection against aborts and do not use an At_End handler for
a controlled type with relaxed finalization semantics.
* exp_ch7.ads (Make_Finalize_Call_For_Node): New function.
* exp_ch7.adb (Finalize_Address_For_Node): New function renaming.
(Set_Finalize_Address_For_Node): New procedure renaming.
(Attach_Object_To_Master_Node): Also attach the Finalize_Address
primitive to the Master_Node statically.
(Build_Finalizer): Add Has_Strict_Ctrl_Objs local variable. Insert
back the body of the finalizer at the end of the statement list in
the non-package case and restore the associated support code to
that effect. When all the controlled objects have the relaxed
finalization semantics, do not create a Finalization_Master and
finalize the objects directly instead.
(Processing_Actions): Add Strict parameter and use it to set the
Has_Strict_Ctrl_Objs variable.
(Process_Declarations): Make main loop more robust and adjust
calls to Processing_Actions.
(Make_Finalize_Address_Body): Mark the primitive as inlined if the
type has relaxed finalization semantics.
(Make_Finalize_Call_For_Node): New function.
* sem_ch6.adb (Check_Statement_Sequence): Skip subprogram bodies.
* libgnat/s-finpri.ads (Finalize_Object): Add Finalize_Address
parameter.
(Master_Node): Remove superfluous qualification.
* libgnat/s-finpri.adb (Attach_Object_To_Node): Likewise.
(Finalize_Master): Adjust calls to Finalize_Object.
(Finalize_Object): Add Finalize_Address parameter and assert that
it is equal to the component of the node. Use the Object_Address
component as guard.
(Suppress_Object_Finalize_At_End): Clear Object_Address component.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2024-08-01 Arnaud Charlet <charlet@adacore.com>
* bindgen.adb (Gen_Main): Put back support for -G
* bindusg.adb (Display): Put back line for -G
* opt.ads (CCG_Mode): Update doc
* switch-b.adb (Scan_Binder_Switches): Put back support for -G
2024-08-01 Ghjuvan Lacambre <lacambre@adacore.com>
* exp_pakd.adb (Expand_Bit_Packed_Element_Set): Disable expansion
in CodePeerMode.
(Expand_Packed_Address_Reference): Likewise.
(Expand_Packed_Bit_Reference): Likewise.
(Expand_Packed_Boolean_Operator): Likewise.
(Expand_Packed_Element_Reference): Likewise.
(Expand_Packed_Eq): Likewise.
(Expand_Packed_Not): Likewise.
2024-08-01 Piotr Trojanek <trojanek@adacore.com>
* sem_ch13.adb (Check_Aspect_Too_Late): Move routine to top-level.
(Resolve_Aspect_Expressions): Check aspects Default_Value and
Default_Component_Value before resolving their expressions.
2024-08-01 Piotr Trojanek <trojanek@adacore.com>
* sem_ch13.adb (Check_Aspect_Too_Late): Prevent freezing during
preanalysis.
2024-08-01 Piotr Trojanek <trojanek@adacore.com>
* sem_ch13.adb (Resolve_Aspect_Expression): Don't set
Must_Not_Freeze before preanalyzing spec expressions.
2024-08-01 Steve Baird <baird@adacore.com>
* sem_disp.adb (Check_Dispatching_Operation): When calling
Error_Msg_NE to generate a "missing overriding indicator" message,
generate a warning message instead of an error message (and update
comment to describe this new behavior).
2024-08-01 Javier Miranda <miranda@adacore.com>
* sem_aggr.adb (Collect_Aggr_Bounds): Adjust previous patch to
store the bounds of inner null aggregates in the itype; required
generate the runtime check of ARM 4.3.3(30).
2024-08-01 Arnaud Charlet <charlet@adacore.com>
* osint-c.ads, osint-c.adb (Create_C_File, Close_C_File,
Delete_C_File): Put back, needed by LLVM based CCG.
* exp_unst.adb (Unnest_Subprogram): Complete previous change by
removing now dead code and corresponding ??? comment.
2024-08-01 Gary Dismukes <dismukes@adacore.com>
* exp_ch3.adb (Build_Record_Init_Proc.Build_Assignment): Do the
component adjustment in the case of initialization by a container
aggregate.
2024-08-01 Eric Botcazou <ebotcazou@adacore.com>
* exp_aggr.adb (Convert_To_Assignments): Set Expansion_Delayed on
intermediate conditional expressions for BIP aggregate returns
too.
* exp_ch4.adb (Expand_N_Case_Expression): Also deal with delayed
expansion in the return case.
(Expand_N_If_Expression): Likewise.
2024-08-01 Steve Baird <baird@adacore.com>
* sem_ch4.adb (Is_Effectively_Visible_Opertor): Return True if
Checking_Potentially_Static_Expression is True. The accompanying
comment says True is returned "if there is a reason it is ok for
Is_Visible_Operator to return False"; if
Checking_Potentially_Static_Expression is true, that is such a
reason.
2024-08-01 Ghjuvan Lacambre <lacambre@adacore.com>
* sem_ch13.adb (Analyze_Attribute_Definition_Clause): Stop
ignoring Component_Size attribute in CodePeer_Mode.
2024-08-01 Ronan Desplanques <desplanques@adacore.com>
* sem_ch5.adb (Prepare_Param_Spec_Loop): Fix criterion for
wrapping loop statements into blocks.
2024-08-01 Arnaud Charlet <charlet@adacore.com>
* bindgen.adb, bindusg.adb, debug.adb, einfo.ads,
exp_aggr.adb, exp_attr.adb, exp_ch11.adb, exp_ch3.adb,
exp_ch4.adb, exp_ch6.adb, exp_ch7.adb, exp_ch8.adb, exp_dbug.adb,
exp_dbug.ads, exp_intr.adb, exp_unst.adb, exp_util.adb,
exp_util.ads, freeze.adb, gen_il-fields.ads,
gen_il-gen-gen_entities.adb, gnat1drv.adb, inline.adb, opt.ads,
osint-c.adb, osint-c.ads, sem_attr.adb, sem_ch12.adb, sem_ch3.adb,
sem_ch4.adb, sem_ch6.adb, sem_elab.adb, sem_res.adb, sinfo.ads,
snames.ads-tmpl, switch-b.adb, switch-c.adb: Major
clean up to remove C code generation for bodies.
2024-08-01 Ronan Desplanques <desplanques@adacore.com>
* exp_aggr.adb (Flatten): Do not reject empty aggregates. Adjust
criterion for emitting warning about ineffective others clause.
* sem_aggr.adb (Array_Aggr_Subtype): Fix typo. Add handling of
aggregates that were converted to positional form.
(Resolve_Aggregate): Tweak criterion for transforming into a
string literal.
(Resolve_Array_Aggregate): Tweak criterion for reusing existing
bounds of aggregate.
(Retrieve_Aggregate_Bounds): New procedure.
* sem_util.adb (Has_Static_Empty_Array_Bounds): New function.
* sem_util.ads (Has_Static_Empty_Array_Bounds): Likewise.
2024-08-01 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch7.ads (Build_Finalizer): Remove Top_Decls parameter.
* exp_ch7.adb (Build_Finalizer): Likewise. Rename Counter_Val into
Count, replace Has_Ctrl_Objs local variable by expression
function, remove Spec_Decls local variable and do not reset
Finalizer_Decls.
(Expand_Cleanup_Actions): Adjust call to Build_Finalizer.
(Expand_N_Package_Body): Likewise.
(Expand_N_Package_Declaration): Likewise.
* inline.adb (Cleanup_Scopes): Likewise.
2024-08-01 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch7.adb (Make_Address_For_Finalize): Generate a direct call
to the "+" operator of System.Storage_Elements.
(Make_Finalize_Address_Stmts): Likewise.
* rtsfind.ads (RE_Id): Remove RE_Add_Offset_To_Address.
(RE_Unit_Table): Remove entry for RE_Add_Offset_To_Address.
* libgnat/s-finpri.ads (Add_Offset_To_Address): Delete.
* libgnat/s-finpri.adb (Add_Offset_To_Address): Likewise.
2024-07-07 Maciej W. Rozycki <macro@orcam.me.uk>
* gcc-interface/Make-lang.in (ada.all.cross): Move recipe to...
(GNATTOOLS_CROSS_MV): ... this new variable.
(cross-gnattools): Paste it here.
(gnattools-cross-mv): New target.
2024-07-03 Alexandre Oliva <oliva@adacore.com>
* gcc-interface/misc.cc (gnat_get_array_descr_info): Only follow
TYPE_DEBUG_TYPE if TYPE_CAN_HAVE_DEBUG_TYPE_P.
* gcc-interface/utils.cc (sized_type_hash): New struct.
(sized_type_hasher): New struct.
(sized_type_hash_table): New variable.
(init_gnat_utils): Allocate it.
(destroy_gnat_utils): Release it.
(sized_type_hasher::equal): New.
(hash_sized_type): New.
(canonicalize_sized_type): New.
(make_type_from_size): Use it to cache packed variants. Fix
type reuse by combining biased_p and for_biased earlier. Hold
the combination in for_biased, adjusting later uses.
2024-07-03 Alexandre Oliva <oliva@adacore.com>
* gcc-interface/cuintp.cc (UI_To_gnu): Add mode that selects a
wide enough unsigned type. Fail if the constant exceeds the
representable numbers.
* gcc-interface/decl.cc (gnat_to_gnu_entity): Use it for
numerator and denominator of fixed-point types. In case of
failure, fall back to an indeterminate fraction.
2024-07-02 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch4.adb (Expand_Concatenate): In the case where an operand
does not have both bounds known at compile time, use nevertheless
the low bound directly if it is known at compile time.
Fold the conditional expression giving the low bound of the result
in the general case if the low bound of all the operands are equal.
2024-07-02 Ronan Desplanques <desplanques@adacore.com>
* sem_ch12.adb (Save_And_Reset): Fix value of low bound used to
reset table.
2024-07-02 Steve Baird <baird@adacore.com>
* sem_attr.adb
(Analyze_Image_Attribute.Check_Image_Type): Check for
E_Access_Attribute_Type prefix type.
2024-07-02 Steve Baird <baird@adacore.com>
* exp_ch9.adb
(Expand_N_Protected_Body): Declare new procedure
Unanalyze_Use_Clauses and call it before analyzing the newly
constructed subprogram body.
2024-07-02 Steve Baird <baird@adacore.com>
* exp_put_image.adb
(Build_Record_Put_Image_Procedure): Declare new Boolean-valued
function Null_Record_Default_Implementation_OK; call it as part of
deciding whether to generate "(NULL RECORD)" text.
2024-07-02 Justin Squirek <squirek@adacore.com>
* sem_ch5.adb:
(Analyze_Assignment): Add special expansion for qualified expressions
in certain cases dealing with mutably tagged types.
2024-07-02 Bob Duff <duff@adacore.com>
* freeze.adb (Freeze_Type_Refs): If Node is in N_Has_Etype,
check that it has had its Etype set, because this can be
called early for expression functions that are completions.
2024-07-02 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch4.adb (Expand_Array_Comparison): Remove the obsolete byte
addressibility test. If Support_Composite_Compare_On_Target is true,
immediately return for a component size of 8, an unsigned component
type and aligned operands. Disable when Unnest_Subprogram_Mode is
true (for LLVM).
(Expand_N_Op_Eq): Adjust comment.
* targparm.ads (Support_Composite_Compare_On_Target): Replace bit by
byte in description and document support for ordering comparisons.
* gcc-interface/utils2.cc (compare_arrays): Rename into...
(compare_arrays_for_equality): ...this. Remove redundant lines.
(compare_arrays_for_ordering): New function.
(build_binary_op) <comparisons>: Call compare_arrays_for_ordering
to implement ordering comparisons for arrays.
2024-07-02 Yannick Moy <moy@adacore.com>
* contracts.adb (Analyze_Pragmas_In_Declarations): Analyze
pragmas in two iterations over the list of declarations in
order to analyze some pragmas before others.
* einfo-utils.ads (Get_Pragma): Fix comment.
* sem_prag.ads (Pragma_Significant_To_Subprograms): Fix.
(Pragma_Significant_To_Subprograms_Analyzed_First): Add new
global array to identify these pragmas which should be analyzed
first, which concerns only Extensions_Visible for now.
2024-07-02 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch7.adb (Convert_View): Add third parameter Typ and use it if
the second parameter does not have an Etype.
(Make_Adjust_Call): Remove obsolete setting of Etype and pass Typ in
call to Convert_View.
(Make_Final_Call): Likewise.
(Make_Init_Call): Pass Typ in call to Convert_View.
2024-07-02 Javier Miranda <miranda@adacore.com>
* sem_aggr.adb (Cannot_Compute_High_Bound): New subprogram.
(Report_Null_Array_Constraint_Error): New subprogram.
(Collect_Aggr_Bounds): For null aggregates, build the bounds
of the inner dimensions.
(Has_Null_Aggregate_Raising_Constraint_Error): New subprogram.
(Subtract): New subprogram.
(Resolve_Array_Aggregate): Report a warning when the index of
null array aggregates is an enumeration type or a modular type
at we can statically determine that the program will raise CE
at runtime computing its high bound.
(Resolve_Null_Array_Aggregate): ditto.
2024-07-02 Eric Botcazou <ebotcazou@adacore.com>
* doc/gnat_rm/standard_and_implementation_defined_restrictions.rst
(No_Default_Initialization): Mention components alongside variables.
* exp_aggr.adb (Build_Array_Aggr_Code.Gen_Assign): Check that the
restriction No_Default_Initialization is not in effect for default
initialized component.
(Build_Record_Aggr_Code): Likewise.
* gnat_rm.texi: Regenerate.
2024-07-02 Eric Botcazou <ebotcazou@adacore.com>
* debug.adb (dJ): Add back as unused.
2024-06-27 Eric Botcazou <ebotcazou@adacore.com>
* libgnat/s-carsi8.adb: Remove clauses for System.Address_Operations
and use only operations of System.Storage_Elements for addresses.
* libgnat/s-casi16.adb: Likewise.
* libgnat/s-casi32.adb: Likewise.
* libgnat/s-casi64.adb: Likewise.
* libgnat/s-casi128.adb: Likewise.
* libgnat/s-carun8.adb: Likewise.
* libgnat/s-caun16.adb: Likewise.
* libgnat/s-caun32.adb: Likewise.
* libgnat/s-caun64.adb: Likewise.
* libgnat/s-caun128.adb: Likewise.
* libgnat/s-geveop.adb: Likewise.
2024-06-27 Javier Miranda <miranda@adacore.com>
* sem_ch2.adb (Analyze_Interpolated_String_Literal): Report
interpretations of ambiguous parameterless function calls.
2024-06-27 Eric Botcazou <ebotcazou@adacore.com>
* sem_ch5.adb (Analyze_Target_Name): Call Analyze_Dimension on the
node once the Etype is set.
* sem_dim.adb (OK_For_Dimension): Set to True for N_Target_Name.
(Analyze_Dimension): Call Analyze_Dimension_Has_Etype for it.
2024-06-27 Ronan Desplanques <desplanques@adacore.com>
* mdll.adb (Build_Non_Reloc_DLL): Fix incorrect assignment
to array object.
(Ada_Build_Non_Reloc_DLL): Likewise.
2024-06-27 Javier Miranda <miranda@adacore.com>
* sem_res.adb (Has_Applicable_User_Defined_Literal): Add missing
support for interpolated strings.
2024-06-27 Martin Clochard <clochard@adacore.com>
* sem_ch6.adb (Check_Overriding_Indicator) Remove Comes_From_Source filter.
(New_Overloaded_Entity) Move up special case of LSP_Subprogram,
and remove Comes_From_Source filter.
2024-06-27 Eric Botcazou <ebotcazou@adacore.com>
* aspects.ads (Aspect_Id): Add Aspect_Finalizable.
(Implementation_Defined_Aspect): Add True for Aspect_Finalizable.
(Operational_Aspect): Add True for Aspect_Finalizable.
(Aspect_Argument): Add Expression for Aspect_Finalizable.
(Is_Representation_Aspect): Add False for Aspect_Finalizable.
(Aspect_Names): Add Name_Finalizable for Aspect_Finalizable.
(Aspect_Delay): Add Always_Delay for Aspect_Finalizable.
* checks.adb: Add with and use clauses for Sem_Elab.
(Install_Primitive_Elaboration_Check): Call Is_Controlled_Procedure.
* einfo.ads (Has_Relaxed_Finalization): Document new flag.
(Is_Controlled_Active): Update documentation.
* exp_aggr.adb (Generate_Finalization_Actions): Replace Find_Prim_Op
with Find_Controlled_Prim_Op for Name_Finalize.
* exp_attr.adb (Expand_N_Attribute_Reference) <Finalization_Size>:
Return 0 if the prefix type has relaxed finalization.
* exp_ch3.adb (Build_Equivalent_Record_Aggregate): Return Empty if
the type needs finalization.
(Expand_Freeze_Record_Type): Call Find_Controlled_Prim_Op instead of
Find_Prim_Op for Name_{Adjust,Initialize,Finalize}.
Call Make_Finalize_Address_Body for all controlled types.
* exp_ch4.adb (Insert_Dereference_Action): Do not generate a call to
Adjust_Controlled_Dereference if the designated type has relaxed
finalization.
* exp_ch6.adb (Needs_BIP_Collection): Return false for an untagged
type that has relaxed finalization.
* exp_ch7.adb (Allows_Finalization_Collection): Return false if the
designated type has relaxed finalization.
(Check_Visibly_Controlled): Call Find_Controlled_Prim_Op instead of
Find_Prim_Op.
(Make_Adjust_Call): Likewise.
(Make_Deep_Record_Body): Likewise.
(Make_Final_Call): Likewise.
(Make_Init_Call): Likewise.
* exp_disp.adb (Set_All_DT_Position): Remove obsolete warning.
* exp_util.ads: Add with and use clauses for Snames.
(Find_Prim_Op): Add precondition.
(Find_Controlled_Prim_Op): New function declaration.
(Name_Of_Controlled_Prim_Op): Likewise.
* exp_util.adb: Remove with and use clauses for Snames.
(Build_Allocate_Deallocate_Proc): Do not build finalization actions
if the designated type has relaxed finalization.
(Find_Controlled_Prim_Op): New function.
(Find_Last_Init): Call Find_Controlled_Prim_Op instead of
Find_Prim_Op.
(Name_Of_Controlled_Prim_Op): New function.
* freeze.adb (Freeze_Entity.Freeze_Record_Type): Propagate the
Has_Relaxed_Finalization flag from components.
* gen_il-fields.ads (Opt_Field_Enum): Add Has_Relaxed_Finalization.
* gen_il-gen-gen_entities.adb (Entity_Kind): Likewise.
* sem_aux.adb (Is_By_Reference_Type): Return true for all controlled
types.
* sem_ch3.adb (Build_Derived_Record_Type): Do not special case types
declared in Ada.Finalization.
(Record_Type_Definition): Propagate the Has_Relaxed_Finalization
flag from components.
* sem_ch13.adb (Analyze_Aspects_At_Freeze_Point): Also process the
Finalizable aspect.
(Analyze_Aspect_Specifications): Likewise. Call Flag_Non_Static_Expr
in more cases.
(Check_Aspect_At_Freeze_Point): Likewise.
(Inherit_Aspects_At_Freeze_Point): Likewise.
(Resolve_Aspect_Expressions): Likewise.
(Resolve_Finalizable_Argument): New procedure.
(Validate_Finalizable_Aspect): Likewise.
* sem_elab.ads: Add with and use clauses for Snames.
(Is_Controlled_Procedure): New function declaration.
* sem_elab.adb: Remove with and use clauses for Snames.
(Is_Controlled_Proc): Move to...
(Is_Controlled_Procedure): ...here and rename.
(Check_A_Call): Call Find_Controlled_Prim_Op instead of
Find_Prim_Op.
(Is_Finalization_Procedure): Likewise.
* sem_util.ads (Propagate_Controlled_Flags): Update documentation.
* sem_util.adb (Is_Fully_Initialized_Type): Replace call to
Find_Optional_Prim_Op with Find_Controlled_Prim_Op.
Call Has_Null_Extension only for derived tagged types.
(Propagate_Controlled_Flags): Propagate Has_Relaxed_Finalization.
* snames.ads-tmpl (Name_Finalizable): New name.
(Name_Relaxed_Finalization): Likewise.
* libgnat/s-finroo.ads (Root_Controlled): Add Finalizable aspect.
* doc/gnat_rm/gnat_language_extensions.rst: Document implementation
of Generalized Finalization.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2024-06-21 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.cc (Subprogram_Body_to_gnu): Also return early
for a protected subprogram in -gnatc mode.
2024-06-21 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.cc (gnat_to_gnu_entity) <discrete_type>: Set
the TYPE_JUSTIFIED_MODULAR_P flag earlier.
* gcc-interface/misc.cc (gnat_unit_size_without_reusable_padding):
New function.
(LANG_HOOKS_UNIT_SIZE_WITHOUT_REUSABLE_PADDING): Redefine to above
function.
2024-06-21 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/utils.cc (clear_decl_bit_field): New function.
(finish_record_type): Call clear_decl_bit_field instead of clearing
DECL_BIT_FIELD manually.
2024-06-21 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.cc (gnat_to_gnu) <N_Op_Mod>: Fix formatting.
* gcc-interface/utils2.cc: Include optabs-query.h.
(fast_modulo_reduction): Call can_mult_highpart_p on the TYPE_MODE
before generating a high-part multiply. Fix formatting.
2024-06-21 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/gigi.h (fast_modulo_reduction): Declare.
* gcc-interface/trans.cc (gnat_to_gnu) <N_Op_Mod>: In the unsigned
case, call fast_modulo_reduction for {FLOOR,TRUNC}_MOD_EXPR if the
RHS is a constant and not a power of two, and the precision is not
larger than the word size.
* gcc-interface/utils2.cc: Include expmed.h.
(fast_modulo_reduction): New function.
(nonbinary_modular_operation): Call fast_modulo_reduction for the
multiplication if the precision is not larger than the word size.
2024-06-21 Javier Miranda <miranda@adacore.com>
* sem_ch2.adb (Analyze_Interpolated_String_Literal): Reject
ambiguous function calls.
2024-06-21 Ronan Desplanques <desplanques@adacore.com>
* sem_util.adb (Examine_Array_Bounds): Add missing return
statements. Fix criterion for a string literal being empty.
2024-06-21 Eric Botcazou <ebotcazou@adacore.com>
* bcheck.adb (Check_Consistency_Of_Sdep): Guard against path to ALI
file not found.
2024-06-21 Javier Miranda <miranda@adacore.com>
* sem_ch13.adb (Analyze_One_Aspect): Fix code locating the entity
of the parent type.
2024-06-21 Marc Poulhiès <poulhies@adacore.com>
* make.adb (Scan_Make_Arg): Adjust error message.
* gnatls.adb (Search_RTS): Likewise.
* switch-b.adb (Scan_Debug_Switches): Likewise.
2024-06-21 Eric Botcazou <ebotcazou@adacore.com>
* einfo.ads (Direct_Primitive_Operations): Mention concurrent types
as well as GNAT extensions instead of implementation details.
(Primitive_Operations): Document that Direct_Primitive_Operations is
also used for concurrent types as a fallback.
* einfo-utils.adb (Primitive_Operations): Tweak formatting.
* exp_util.ads (Find_Prim_Op): Adjust description.
* exp_util.adb (Make_Subtype_From_Expr): In the private case with
unknown discriminants, always copy Direct_Primitive_Operations and
do not overwrite the Class_Wide_Type of the expression's base type.
* sem_ch3.adb (Analyze_Incomplete_Type_Decl): Tweak comment.
(Analyze_Subtype_Declaration): Remove older and now dead calls to
Set_Direct_Primitive_Operations. Tweak comment.
(Build_Derived_Private_Type): Likewise.
(Build_Derived_Record_Type): Likewise.
(Build_Discriminated_Subtype): Set Direct_Primitive_Operations in
all cases instead of just for tagged types.
(Complete_Private_Subtype): Likewise.
(Derived_Type_Declaration): Tweak comment.
* sem_ch4.ads (Try_Object_Operation): Adjust description.
2024-06-21 Doug Rupp <rupp@adacore.com>
* init.c [vxworks] (__gnat_install_handler): Revert to
installing signal handlers without regard to interrupt_state.
2024-06-21 Javier Miranda <miranda@adacore.com>
* sem_disp.adb (Find_Hidden_Overridden_Primitive): Check
public dispatching primitives of ancestors; previously,
only immediately-visible primitives were checked.
2024-06-21 Eric Botcazou <ebotcazou@adacore.com>
* checks.adb (Generate_Index_Checks): Add specific treatment for
index expressions that are N_Expression_With_Actions nodes.
2024-06-21 Eric Botcazou <ebotcazou@adacore.com>
* sem_ch4.adb (Analyze_Selected_Component): Rename Name into Pref
and use Sel local variable consistently.
(Is_Simple_Indexed_Component): New predicate.
Call Is_Simple_Indexed_Component to determine whether to build an
actual subtype for the component.
2024-06-21 Eric Botcazou <ebotcazou@adacore.com>
* freeze.adb (Freeze_Array_Type): Decouple the handling of the
interaction between packing and aliased/atomic components from
that of the interaction between a component clause and aliased/
atomic components, and retrofit the processing of the interaction
between the two characteristics and independent components into
the common processing.
2024-06-21 Bob Duff <duff@adacore.com>
* gen_il-gen-gen_nodes.adb
(N_Generic_Package_Declaration): Remove Activation_Chain_Entity.
* sinfo.ads: Comment improvements. Add missing doc.
Remove obsolete comment about Activation_Chain_Entity.
* einfo.ads: Comment improvements. Add missing doc.
* einfo-utils.adb (Base_Type): Add Assert (disabled for now).
(Next_Index): Minor cleanup.
* aspects.ads: Minor comment fix.
* exp_ch6.adb: Likewise.
* sem_ch3.adb: Likewise.
2024-06-21 Piotr Trojanek <trojanek@adacore.com>
* sem_ch3.adb (Add_Interface_Tag_Components): Simplify with No.
2024-06-21 Steve Baird <baird@adacore.com>
* sem_ch4.adb (Is_Effectively_Visible_Operator): A new function.
(Check_Arithmetic_Pair): In paths where Add_One_Interp was
previously called unconditionally, instead call only if
Is_Effectively_Visible_Operator returns True.
(Check_Boolean_Pair): Likewise.
(Find_Unary_Types): Likewise.
2024-06-21 Eric Botcazou <ebotcazou@adacore.com>
* accessibility.adb (Accessibility_Level): Apply the processing to
Expr when its Original_Node is an unanalyzed identifier.
2024-06-21 Piotr Trojanek <trojanek@adacore.com>
* sem_attr.adb (In_Aspect_Specification): Use the standard
condition that works correctly with declare expressions.
* sem_ch13.adb (Analyze_Aspects_At_Freeze_Point): Replace
ordinary analysis with preanalysis of spec expressions.
2024-06-21 Justin Squirek <squirek@adacore.com>
* csets.ads (Identifier_Char): New function - replacing table.
* csets.adb (Identifier_Char): Rename and move table for static values.
(Initialize): Remove dynamic calculations.
(Identifier_Char): New function to calculate dynamic values.
* opt.adb (Set_Config_Switches): Remove setting of Identifier_Char.
2024-06-20 Steve Baird <baird@adacore.com>
* sem_attr.adb (Resolve_Attribute.Proper_Op): When resolving the
name of the reducer subprogram in a reduction expression,
Proper_Op treats references to operators defined in Standard
specially. Disable this special treatment if the type of the
reduction expression is not the right class of type for the
operator, or if a new Boolean parameter (named "Strict") is True.
(Resolve_Attribute): In the overloaded case, iterate over the
reducer subprogram candidates twice. First with Strict => True and
then, if no good intepretation is found, with Strict => False.
2024-06-20 Yannick Moy <moy@adacore.com>
* ghost.adb (Check_Ghost_Type): Fix checking.
2024-06-20 Bob Duff <duff@adacore.com>
* expander.ads: Minor comment fixes.
* nlists.ads: Misc comment improvements.
* sem_aux.ads (First_Discriminant): Improve comment.
* sem_ch12.adb: Misc cleanups.
(Associations): New package containing type Gen_Assocs_Rec
to represent matchings, and function Match_Assocs to create the
Gen_Assocs_Rec constant.
(Analyze_Associations): Call Match_Assocs, and other major
changes related to that.
* sem_ch12.ads: Minor comment fixes.
* sem_ch3.adb: Minor comment fixes.
2024-06-20 Steve Baird <baird@adacore.com>
* doc/gnat_rm/gnat_language_extensions.rst: Update documentation.
* doc/gnat_rm/implementation_defined_pragmas.rst: Update
documentation.
* errout.adb
(Error_Msg_GNAT_Extension): Update error message text.
* par-prag.adb: Update pragma parsing. This includes changing the
the name of the Check_Arg_Is_On_Or_Off formal parameter All_OK_Too
to All_Extensions_OK_Too.
* sem_prag.adb (Analyze_Pragma): In analyzing an
Extensions_Allowed pragma, replace uses of Name_All with
Name_All_Extensions; update a comment to reflect this.
* snames.ads-tmpl: Add Name_All_Extensions declaration.
* gnat_rm.texi: Regenerate.
2024-06-20 Gary Dismukes <dismukes@adacore.com>
* sem_ch4.adb (Try_Selected_Component_In_Instance): Reverse if_statement
clauses so that the testing for the special case of extensions of private
types in instance bodies is done first, followed by the testing for the case
of a parent type that's a generic actual type. In the extension case, apply
Base_Type to the type actual in the test of Used_As_Generic_Actual, and add
a test of Present (Parent_Subtype (Typ)).
2024-06-20 Yannick Moy <moy@adacore.com>
* inline.adb (Establish_Actual_Mapping_For_Inlined_Call): In the
case of formal with a fixed lower bounds, insert appropriate
conversion like in the case of a constrained type.
* tbuild.adb (Unchecked_Convert_To): Do not skip the conversion
when it may involve sliding due to a type with fixed lower bound.
2024-06-20 Eric Botcazou <ebotcazou@adacore.com>
* sem_ch12.adb (Instantiate_Formal_Package): Accept renamings of a
generic parent that is a child unit for the abbreviated instance.
2024-06-20 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch4.adb (Expand_Composite_Equality): In the untagged record
case, always look for a user-defined equality operator in Ada 2012.
2024-06-20 Doug Rupp <rupp@adacore.com>
* ali.ads (Interrupts_Default_To_System): New boolean.
(Interrupts_Default_To_System_Specified): New boolean.
* ali.adb (Interrupts_Default_To_System_Specified): Initialize.
(Interrupts_Default_To_System): Initialize.
(Scan_ALI): Processing for "ID".
* bindgen.adb: Coallesce comments on interrupt settings to ...
(Gen_Adainit): Import Interrupts_Default_To_System flag and set if
pragma specified.
(Gen_Output_File_Ada): Generate Local_Interrupt_States according
to pragma.
* init.c: ... here.
[vxworks] (__gnat_install_handler): Test for interrupt_state.
(__gl_interrupts_default_to_system): New global flag.
(__gnat_get_interrupt_State): return interrupt state according to
new global flag.
* lib-writ.ads: Document "ID".
* lib-writ.adb: Write out "ID".
* opt.ads (Interrupts_System_By_Default): New boolean, defaulted
to False.
* par-prag.adb (Pragma_Interrupts_System_By_Default): New.
* sem_prag.adb (Pragma_Interrupts_System_By_Default): Handle it.
(Pragma_Interrupts_System_By_Default): Default it.
* snames.ads-tmpl (Name_Interrupts_System_By_Default): New name.
(Pragma_Interrupts_System_By_Default): New
* libgnarl/s-intman__posix.adb (Initialize): Ensure the
Keep_Unmasked signal is sigset-able.
* doc/gnat_rm/implementation_defined_pragmas.rst: Document pragma
Interrupts_System_By_Default.
* doc/gnat_ugn/the_gnat_compilation_model.rst (Configuration
pragmas): Add Interrupts_System_By_Default. (Partition-Wide
Settings): Mention pragma Interrupts_System_By_Default.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2024-06-20 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch4.adb (Expand_Array_Equality.Component_Equality): Copy the
Comes_From_Source flag from the original test to the new one, and
remove obsolete code dealing with unchecked unions.
* sem_util.adb (Has_Inferable_Discriminants): Return False for an
incomplete or private nominal subtype.
2024-06-20 Eric Botcazou <ebotcazou@adacore.com>
* freeze.adb (Freeze_Expression): Also attach pending freeze nodes
to the parent in the case of an internal block in a spec expression.
2024-06-20 Eric Botcazou <ebotcazou@adacore.com>
* debug.adb (d_l): Document new usage for the compiler.
* freeze.adb (Check_Strict_Alignment): Set the Strict_Alignment
flag on array types with aliased component, except if the
component size is equal to the storage unit or the -gnatd_l switch
is specified.
2024-06-20 Eric Botcazou <ebotcazou@adacore.com>
* doc/gnat_rm/implementation_advice.rst (Representation Clauses):
Remove >> marker and add end of sentence after code-block directive.
(RM 13.5.3(7-8)): Update to Ada 2005 wording.
* doc/gnat_rm/implementation_defined_characteristics.rst
(RM 13.5.3(5)): Likewise.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2024-06-20 Piotr Trojanek <trojanek@adacore.com>
* doc/gnat_rm/implementation_defined_aspects.rst
(Aspect Subprogram_Variant): Refer to SPARK User's Guide.
* doc/gnat_rm/implementation_defined_pragmas.rst
(Pragma Subprogram_Variant): Document syntax to satisfy the
convention; refer to SPARK User's Guide for semantics.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2024-06-20 Eric Botcazou <ebotcazou@adacore.com>
* freeze.adb (Freeze_Array_Type): Call Propagate_Controlled_Flags
to propagate the controlled flags from the component to the array.
(Freeze_Record_Type): Propagate the Finalize_Storage_Only flag
from the components to the record.
* sem_ch3.adb (Analyze_Private_Extension_Declaration): Do not call
Propagate_Concurrent_Flags here but...
(Array_Type_Declaration): Tidy and call Propagate_Controlled_Flags
to propagate the controlled flags from the component to the array.
(Build_Derived_Private_Type): Do not propagate the controlled flags
manually here but...
(Build_Derived_Record_Type): ...call Propagate_Controlled_Flags to
propagate the controlled flags from parent to derived type.
(Build_Derived_Type): Likewise.
(Copy_Array_Base_Type_Attributes): Call Propagate_Controlled_Flags
to copy the controlled flags.
(Record_Type_Definition): Streamline the propagation of the
Finalize_Storage_Only flag from the components to the record.
* sem_ch7.adb (Preserve_Full_Attributes): Use Full_Base and call
Propagate_Controlled_Flags to copy the controlled flags.
* sem_ch9.adb (Analyze_Protected_Definition): Use canonical idiom
to compute Has_Controlled_Component.
(Analyze_Protected_Type_Declaration): Minor tweak.
* sem_ch13.adb (Inherit_Aspects_At_Freeze_Point): Do not deal with
Finalize_Storage_Only here.
* sem_util.ads (Propagate_Controlled_Flags): New declaration.
* sem_util.adb (Propagate_Controlled_Flags): New procedure.
2024-06-20 Piotr Trojanek <trojanek@adacore.com>
* freeze.adb (Check_Current_Instance): This routine is only called
with parameter E being a type entity, so there is no need to check
for types just before the equality with E.
* sem_ch13.adb (Analyze_Aspect_Specifications): Regroup condition
to avoid unnecessary evaluation.
(Check_Aspect_At_End_Of_Declarations): If In_Instance is true,
then the routine exits early.
2024-06-20 Piotr Trojanek <trojanek@adacore.com>
* freeze.adb (Find_Aspect_No_Parts): Tune whitespace.
* sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Fix style.
2024-06-20 Eric Botcazou <ebotcazou@adacore.com>
* aspects.ads (Aspect_Id): Remove Aspect_Max_Entry_Queue_Depth.
(global arrays): Remove entry for it.
* exp_ch9.adb (Expand_N_Protected_Type_Declaration): Remove
reference to pragma Max_Entry_Queue_Depth in comment.
* par-prag.adb (Prag): Remove handling of
Pragma_Max_Entry_Queue_Depth.
* sem_ch13.adb (Analyze_Aspect_Specifications): Remove reference
to aspect Max_Entry_Queue_Depth in comment.
(Analyze_Aspect_Specifications): Remove processing of aspect
Max_Entry_Queue_Depth.
(Check_Aspect_At_Freeze_Point): Likewise.
* sem_prag.ads (Find_Related_Declaration_Or_Body): Remove
reference to pragma Max_Entry_Queue_Depth in comment.
* sem_prag.adb (Analyze_Pragma): Remove processing of pragma
Max_Entry_Queue_Depth.
(Sig_Flags): Remove entry for Pragma_Max_Entry_Queue_Depth.
* sem_util.adb (Get_Max_Queue_Length): Remove handling of pragma
Max_Entry_Queue_Depth.
(Has_Max_Queue_Length): Likewise.
* snames.ads-tmpl (Name_Max_Entry_Queue_Depth): Move back from
pragmas section to others section.
(Pragma_Id): Remove Pragma_Max_Entry_Queue_Depth.
2024-06-20 Eric Botcazou <ebotcazou@adacore.com>
* doc/gnat_rm/gnat_language_extensions.rst (Pragma Storage_Model):
Rename to Storage Model.
* doc/gnat_rm/implementation_defined_aspects.rst: Alphabetize.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2024-06-20 Ronan Desplanques <desplanques@adacore.com>
* gnat1drv.adb (Gnat1drv): Add coverage instrumentation
annotations.
2024-06-20 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch3.adb (Expand_Freeze_Array_Type): Do not propagate the
concurrent flags and the Has_Controlled_Component flag here.
(Expand_Freeze_Record_Type): Likewise.
* freeze.adb (Freeze_Array_Type): Propagate the concurrent flags.
(Freeze_Record_Type): Likewise.
* sem_util.adb (Has_Some_Controlled_Component): Adjust comment.
2024-06-20 Eric Botcazou <ebotcazou@adacore.com>
* mutably_tagged.ads: Fix minor issues in comments throughout.
2024-06-20 Richard Kenner <kenner@adacore.com>
* debug.adb: Add documentation for -gnatd_w.
2024-06-20 Viljar Indus <indus@adacore.com>
* doc/gnat_ugn/building_executable_programs_with_gnat.rst: Update
documentation for -gnatw.v.
* sem_ch13.adb: Convert all -gnatw.v related messages to warnings.
* gnat_ugn.texi: Regenerate.
2024-06-20 Viljar Indus <indus@adacore.com>
* doc/gnat_ugn/building_executable_programs_with_gnat.rst: Update
documentation for -gnatw.n switch.
* exp_util.adb: Convert info messages into warnings.
* gnat_ugn.texi: Regenerate.
2024-06-20 Viljar Indus <indus@adacore.com>
* doc/gnat_ugn/building_executable_programs_with_gnat.rst: Add
entry for -gnatis.
* errout.adb (Error_Msg_Internal): Stop printing info messages if
-gnatis was used.
* opt.ads: Add Info_Suppressed flag to track whether info messages
should be suppressed.
* switch-c.adb: Add parsing for -gnatis.
* gnat_ugn.texi: Regenerate.
2024-06-20 Viljar Indus <indus@adacore.com>
* atree.ads: Remove Warning_Info_Messages.
* errout.adb: Remove various places where Warning_Info_Messages
was used.
* erroutc.adb: Remove various places where Warning_Info_Messages
was used. Create Error_Msg_Object objects with only an info
attribute if the message contained both info and warning insertion
characters. New method Has_Switch_Tag for detecting if a message
should have an error tag.
* errutil.adb: Create Error_Msg_Object objects with only an info
attribute if the message contained both info and warning insertion
characters.
2024-06-20 Justin Squirek <squirek@adacore.com>
* doc/gnat_rm/gnat_language_extensions.rst: Add entry for 'Super.
* doc/gnat_rm/implementation_defined_attributes.rst: Remove entry
for 'Super.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2024-06-20 Steve Baird <baird@adacore.com>
* gprep.adb (Process_Files.Process_One_File): When calling OS_Exit in an error
path, pass in a Status parameter of 1 instead of 0 (because 0
indicates success).
* lib-load.adb (Load_Main_Source): Do not emit a message about a missing source file
if other error messages were generated by calling Load_Source_File;
the file isn't missing - it failed preprocessing.
2024-06-20 Piotr Trojanek <trojanek@adacore.com>
* sem_attr.adb (Attribute_22): Add Put_Image and Object_Size.
* sem_attr.ads (Attribute_Impl_Def): Remove Object_Size.
2024-06-14 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/Makefile.in (tmake_file): Remove all references.
2024-06-14 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.cc: Include function.h.
(gnat_to_gnu_param): Minor comment tweaks.
(gnat_to_gnu_subprog_type): Take into account the default for the
computation of the return mechanism. Give a warning if a by-copy
specified mechanism cannot be honored.
2024-06-14 Yannick Moy <moy@adacore.com>
* gcc-interface/trans.cc (elaborate_all_entities_for_package)
(process_freeze_entity): Skip entities of kind E_Subprogram_Body.
2024-06-14 Eric Botcazou <ebotcazou@adacore.com>
PR ada/109817
* gcc-interface/trans.cc (maybe_make_gnu_thunk): Create an alias
instead of a null thunk.
2024-06-14 Marc Poulhiès <poulhies@adacore.com>
* gcc-interface/decl.cc (gnat_to_gnu_entity): Typo fix.
(gnat_to_gnu_component_type): Indent fix.
* gcc-interface/gigi.h (build_call_alloc_dealloc): Typo fix.
* gcc-interface/utils.cc (make_dummy_type): Typo fix.
* gcc-interface/utils2.cc (gnat_protect_expr): Indent fix.
2024-06-14 Eric Botcazou <ebotcazou@adacore.com>
* aspects.ads (Aspect_Id): Alphabetize, remove the GNAT tag from
Default_Initial_Condition and Object_Size, move No_Controlled_Parts
and No_Task_Parts to boolean subclass.
(Nonoverridable_Aspect_Id): Add missing Ada 2022 aspects.
(Implementation_Defined_Aspect): Add all missing aspects, remove
Max_Entry_Queue_Length and Object_Size
(Aspect_Argument): Remove specific entries for No_Controlled_Parts
and No_Task_Parts, list boolean aspects last.
(Is_Representation_Aspect ): Move boolean aspects last.
(Aspect_Names): Alphabetize.
* sem_ch13.adb (Analyze_Aspect_Disable_Controlled): Adjust.
(Analyze_Aspect_Specifications): Move around processing for
No_Controlled_Parts and No_Task_Parts.
(Check_Aspect_At_Freeze_Point): Remove specific entries for
No_Controlled_Parts and No_Task_Parts
2024-06-14 Steve Baird <baird@adacore.com>
* exp_attr.adb
(Expand_Loop_Entry_Attribute):
Ensure that Etype of the saved expression is set correctly.
2024-06-14 Jerome Guitton <guitton@adacore.com>
* sysdep.c (S_dosFsLib_FILE_NOT_FOUND, S_nfsLib_NFSERR_NOENT):
New macros, falback to ENOENT when not already defined.
(__gnat_is_file_not_found_error): Use these new macros to remove
tests against VxWorks flavors.
2024-06-14 Eric Botcazou <ebotcazou@adacore.com>
* snames.ads-tmpl (Name_Present): Move to Repinfo section.
2024-06-14 Justin Squirek <squirek@adacore.com>
* doc/gnat_rm/gnat_language_extensions.rst: Add documentation for
mutably tagged type feature.
* aspects.ads: Add registration for 'Size'Class.
* einfo.ads: Add documentation for new components
Class_Wide_Equivalent_Type and Is_Mutably_Tagged_Type.
* exp_aggr.adb (Gen_Assign): Assume associated mutably tagged type
when class-wide equivalent type is encountered.
(Contains_Mutably_Tagged_Type): New subprogram.
(Convert_To_Positional): Assume associated mutably tagged type
when class-wide equivalent type is encountered.
(Is_Static_Element): Assume associated mutably tagged type when
class-wide equivalent type is encountered.
(Expand_Array_Aggregate): Assume associated mutably tagged type
when class-wide equivalent type is encountered.
(Expand_Record_Aggregate): Force mutably tagged records to be
expanded into assignments.
* exp_ch3.adb (Build_Array_Init_Proc): Assume associated mutably
tagged type when class-wide equivalent type is encountered.
(Simple_Initialization_OK): Disallow simple initialization for
class-wide equivalent types.
(Build_Init_Statements): Assume associated mutably tagged type
when class-wide equivalent type is encountered.
(Expand_Freeze_Array_Type): Ignore building of record init procs
for mutably tagged types.
(Expand_N_Full_Type_Declaration): Replace mutably tagged type
declarations with their associated class-wide equivalent types.
(Default_Initialize_Object): Add special handling for mutably
tagged types.
* exp_ch4.adb (Expand_N_Allocator): Add initialization for mutably
tagged types.
(Expand_Record_Equality): Generate mutably tagged unchecked
conversions.
* exp_ch5.adb (Expand_N_Assignment_Statement): Generate a special
assignment case for class-wide equivalent types which does tag
assignments and ignores certain checks.
* exp_ch6.adb (Expand_Call_Helper): Propagate constrained extra
formal actuals for mutably tagged types.
* exp_ch7.adb (Make_Init_Call): Handle mutably tagged type
initialization.
* exp_util.adb (Make_CW_Equivalent_Type): Modify to handle mutably
tagged objects which contain no initialization expression.
(Make_Subtype_From_Expr): Modify call to Make_CW_Equivalent_Type.
* exp_util.ads (Make_CW_Equivalent_Type): Move declaration from
body to spec.
* freeze.adb (Size_Known): No longer return false automatically
when a class-wide type is encountered.
(Freeze_Entity): Ignore error messages about size not being known
for mutably tagged types.
* gen_il-fields.ads: Register new fields
Class_Wide_Equivalent_Type and Is_Mutably_Tagged_Type.
* gen_il-gen-gen_entities.adb: Register new fields
Class_Wide_Equivalent_Type and Is_Mutably_Tagged_Type for type
entities.
* mutably_tagged.adb, mutably_tagged.ads
(Corresponding_Mutably_Tagged_Type): New subprogram.
(Depends_On_Mutably_Tagged_Ext_Comp): New subprogram.
(Get_Corresponding_Mutably_Tagged_Type_If_Present): New
subprogram.
(Get_Corresponding_Tagged_Type_If_Present): New subprogram.
(Is_Mutably_Tagged_Conversion): New subprogram.
(Is_Mutably_Tagged_CW_Equivalent_Type): New subprogram.
(Make_Mutably_Tagged_Conversion): New subprogram.
(Make_CW_Size_Compile_Check): New subprogram.
(Make_Mutably_Tagged_CW_Check): New subprogram.
* sem_aggr.adb (Resolve_Array_Aggregate): Skip tag checks for
class-wide equivalent types.
(Resolve_Aggr_Expr): Assume associated mutably tagged type when
class-wide equivalent type is encountered.
* sem_attr.adb (Analyze_Attribute): Allow 'Tag on mutably tagged
types.
(Resolve_Attribute): Detect errors for dependence of mutably
tagged extension type component.
* sem_ch12.adb (Instantiate_Object): Detect errors for dependence
of mutably tagged extension type component.
* sem_ch13.adb (Analyze_One_Aspect): Propagate 'Size'Class to
class-wide type.
(Analyze_Attribute_Definition_Clause): Add handling of 'Size'Class
by generating class-wide equivalent types and checking for illegal
uses.
* sem_ch2.adb (Analyze_Identifier): Generate unchecked conversion
for class-wide equivalent types.
* sem_ch3.adb (Analyze_Component_Declaration): Avoid unconstrained
errors on mutably tagged types.
(Analyze_Object_Declaration): Rewrite declarations of mutably
tagged types to use class-wide equivalent types.
(Array_Type_Declaration): Modify arrays of mutably tagged types to
use their corresponding class-wide equivalent types.
(Derived_Type_Declaration): Add various checks for mutably tagged
derived types.
* sem_ch4.adb (Analyze_Allocator): Replace reference to mutably
tagged type with cooresponding tagged type.
(Process_Indexed_Component): Generate unchecked conversion for
class-wide equivalent type.
(Analyze_One_Call): Generate unchecked conversion for class-wide
equivalent types.
(Analyze_Selected_Component): Assume reference to class-wide
equivalent type is associated mutably tagged type.
(Analyze_Type_Conversion): Generate unchecked conversion for
class-wide equivalent type.
* sem_ch5.adb (Analyze_Assignment): Assume associated mutably
tagged type when class-wide equivalent type is encountered.
(Analyze_Iterator_Specification): Detect errors for dependence of
mutably tagged extension type component.
* sem_ch6.adb (Create_Extra_Formals): Add code to generate extra
formal for mutably tagged types to signal if they are constrained.
* sem_ch8.adb (Analyze_Object_Renaming): Detect error on renaming
of mutably tagged extension type component.
(Analyze_Renaming_Primitive_Operation): Detect error on renaming
of mutably tagged extension type component.
* sem_res.adb (Resolve_Actuals): Allow class-wide arguments on
class-wide equivalent types.
(Valid_Conversion): Assume associated mutably tagged type when
class-wide equivalent type is encountered.
* sem_util.adb (Is_Fully_Initialized_Type): Flag mutably tagged
types as fully initialized.
(Needs_Simple_Initalization): Flag class-wide equivalent types as
needing initialization.
* gnat_rm.texi: Regenerate.
* gcc-interface/Make-lang.in: Add entry for mutably_tagged.o.
2024-06-14 Justin Squirek <squirek@adacore.com>
* accessibility.adb:
(Accessibility_Level): Replace call Get_Full_View with call to
Full_View since Get_Full_View only works with incomplete types.
2024-06-14 Eric Botcazou <ebotcazou@adacore.com>
* aspects.ads (Operational_Aspect): Alphabetize.
* sem_ch13.ads (Analyze_Aspects_At_Freeze_Point): Fix description.
* sem_ch13.adb (Analyze_Aspects_At_Freeze_Point) <Aggregate>: Give
the error for array types here instead of...
(Analyze_Aspect_Specifications) <Aggregate>: Adjust comment.
(Check_Aspect_At_Freeze_Point) <Aggregate>: ...here.
2024-06-14 Javier Miranda <miranda@adacore.com>
* exp_aggr.adb (Must_Slide): Add missing support for
multidimensional arrays.
2024-06-14 Eric Botcazou <ebotcazou@adacore.com>
* freeze.adb (Freeze_All): Call Check_Aspects_At_End_Of_Declarations
to perform the visibility check for aspects.
* sem_ch13.ads (Check_Aspects_At_End_Of_Declarations): Declare.
(Check_Aspect_At_Freeze_Point): Move to...
(Check_Aspect_At_End_Of_Declarations): Move to...
* sem_ch13.adb (Check_Aspect_At_Freeze_Point): ...here.
(Check_Aspect_At_End_Of_Declarations): ...here.
(Analyze_Aspect_Specifications): Remove peculiar processing for
Stable_Properties, Designated_Storage_Model, Storage_Model_Type
and Aggregate. Move that of Local_Restrictions around. Reset
Aitem at the beginning of the loop for each aspect.
(Check_Aspects_At_End_Of_Declarations): New procedure.
2024-06-14 Justin Squirek <squirek@adacore.com>
* sem_attr.adb:
(Analyze_Attribute): Add check for dereference.
2024-06-14 Eric Botcazou <ebotcazou@adacore.com>
* snames.ads-tmpl (Name_Storage_Model): Delete.
2024-06-14 Alexandre Oliva <oliva@gnu.org>
Revert:
2024-06-12 Alexandre Oliva <oliva@adacore.com>
* gcc-interface/decl.cc (gnat_to_gnu_field): Use unpacked type
as the debug type for packed fields.
2024-06-13 Steve Baird <baird@adacore.com>
* exp_util.adb
(Insert_Actions): Code was relying on an incorrect assumption that an
N_Itype_Reference cannot occur in declaration list or a statement
list. Fix the code to handle this case.
2024-06-13 Viljar Indus <indus@adacore.com>
* debug.adb: Remove mentions of -gnatdJ.
* errout.adb: Remove printing subprogram names to JSON.
* erroutc.adb: Remove printing subprogram names in messages.
* erroutc.ads: Remove Node and Subprogram_Name_Ptr used for -gnatdJ.
* errutil.adb: Remove Node used for -gnatdJ
* gnat1drv.adb: Remove references of -gnatdJ and
Include_Subprgram_In_Messages.
* opt.ads: Remove Include_Subprgram_In_Messages
* par-util.adb: Remove behavior related to
Include_Subprgram_In_Messages.
* sem_util.adb: Remove Subprogram_Name used for -gnatdJ
2024-06-13 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch7.adb (Attach_Object_To_Master_Node): Fix formatting.
(Build_Finalizer.Process_Object_Declaration): Synthesize a local
Finalize_Address primitive if the object's subtype is an array
that has a constrained first subtype and is not this first subtype.
* exp_util.adb (Find_Last_Init): Get again to the base type in the
indirect case.
2024-06-13 Eric Botcazou <ebotcazou@adacore.com>
* doc/gnat_rm/implementation_defined_attributes.rst (Iterable):
Delete entry.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2024-06-13 Yannick Moy <moy@adacore.com>
* sem_util.adb (Check_Ambiguous_Aggregate): Fix test.
2024-06-13 Javier Miranda <miranda@adacore.com>
* freeze.ads (Check_Condition_Entities): Complete documentation.
* freeze.adb (Check_Inherited_Conditions): Extend its functionality to
build two kind of wrappers: the existing LSP wrappers, and wrappers
required to handle postconditions of interface primitives implemented
by inherited primitives.
(Build_Inherited_Condition_Pragmas): Rename formal.
(Freeze_Record_Type): For derived tagged types, move call to
Check_Inherited_Conditions to subprogram Freeze_Entity_Checks;
done to improve the performance of Check_Inherited_Conditions since it
can rely on the internal entities that link interface primitives with
tagged type primitives that implement them.
(Check_Interface_Primitives_Strub_Mode): New subprogram.
* sem_ch13.adb (Freeze_Entity_Checks): Call Check_Inherited_Conditions.
Call Check_Inherited_Conditions with derived interface types to check
strub mode compatibility of their primitives.
* sem_disp.adb (Check_Dispatching_Operation): Adjust assertion to accept
wrappers of interface primitives that have classwide postconditions.
* exp_disp.adb (Write_DT): Adding text to identify wrappers.
2024-06-13 Viljar Indus <indus@adacore.com>
* sem_res.adb (Resolve_Call): add warning insertion
character into the info message.
2024-06-13 Steve Baird <baird@adacore.com>
* sem_util.adb
(New_Copy_Tree.Visit_Entity): Delete code that prevented copying some entities.
2024-06-13 Bob Duff <duff@adacore.com>
* sem_ch12.adb (Check_Fixed_Point_Actual): Minor rewording; it seems
more proper to say "operator" rather than "operation".
(Matching_Actual): Give an error for <> in positional notation.
This is a syntax error. Disable this for now.
(Analyze_Associations): Copy the use clause in all cases.
The "mustn't recopy" comment seems wrong, because New_Copy_Tree
preserves Slocs.
* libgnat/a-ticoau.ads: Fix violation of new postion-box error.
* libgnat/a-wtcoau.ads: Likewise.
* libgnat/a-ztcoau.ads: Likewise.
2024-06-13 Viljar Indus <indus@adacore.com>
* par-labl.adb (Rewrite_As_Loop): Remove info message
2024-06-13 Viljar Indus <indus@adacore.com>
* par-ch7.adb: Remove warning characters from info message
* par-endh.adb: Remove warning characters from info message
* sem_res.adb: Remove warning characters from info message
2024-06-13 Viljar Indus <indus@adacore.com>
* sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): change the
info message to a continuation message.
2024-06-13 Viljar Indus <indus@adacore.com>
* inline.adb (Cannot_Inline): Simplify string handling logic.
2024-06-13 Yannick Moy <moy@adacore.com>
* exp_ch5.adb (Expand_Iterator_Loop_Over_Container): Skip entities
of kind E_Subprogram_Body.
* repinfo.adb (List_Entities): Remove special case for subprogram
bodies.
* sem_ch6.adb (Analyze_Subprogram_Body_Helper): List subprogram
body entities in the enclosing scope.
2024-06-13 Javier Miranda <miranda@adacore.com>
* sem_ch4.adb (Traverse_Interfaces): Add missing support
for climbing to parents of interface types.
2024-06-13 Steve Baird <baird@adacore.com>
* doc/gnat_rm/implementation_defined_attributes.rst:
Update Super attribute documentation.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2024-06-13 Ronan Desplanques <desplanques@adacore.com>
* exp_ch7.adb (Build_Cleanup_Statements): Adapt to changes
made to Build_Protected_Subprogram_Call_Cleanup.
* exp_ch9.adb (Make_Unlock_Statement, Wrap_Unprotected_Call):
New functions.
(Build_Protected_Subprogram_Body): Fix resource management in
generated code.
(Build_Protected_Subprogram_Call_Cleanup): Make use of newly
introduced Make_Unlock_Statement.
2024-06-13 Eric Botcazou <ebotcazou@adacore.com>
PR ada/114710
* exp_util.adb (Find_Renamed_Object): Recurse for any renaming.
2024-06-13 Piotr Trojanek <trojanek@adacore.com>
* sem_prag.adb (Check_Mode_Restriction_In_Enclosing_Context):
Iterate over encapsulating abstract states.
2024-06-13 Eric Botcazou <ebotcazou@adacore.com>
* Makefile.rtl (GNATRTL_NONTASKING_OBJS): Add s-imad32$(objext),
s-imad64$(objext) and s-imagea$(objext).
* exp_atag.ads (Build_Set_Size_Function): Replace Tag_Node parameter
with Typ parameter.
* exp_atag.adb: Add clauses for Sinfo.Utils.
(Build_Set_Size_Function): Retrieve the TSD object statically.
* exp_disp.adb: Add clauses for Ttypes.
(Make_DT): Call Address_Image{32,64] instead of Address_Image.
(Register_Primitive): Pass Tag_Typ to Build_Set_Size_Function.
* rtsfind.ads (RTU_Id): Remove System_Address_Image and add
System_Img_Address_{32;64}.
(RE_Id): Remove entry for RE_Address_Image and add entries for
RE_Address_Image{32,64}.
* rtsfind.adb (System_Descendant): Adjust to above changes.
* libgnat/a-tags.ads (Address_Array): Suppress initialization.
* libgnat/s-addima.adb (System.Address_Image): Call the appropriate
routine based on the address size.
* libgnat/s-imad32.ads: New file.
* libgnat/s-imad64.ads: Likewise.
* libgnat/s-imagea.ads: Likewise.
* libgnat/s-imagea.adb: Likewise.
* gcc-interface/Make-lang.in (GNAT_ADA_OBJS) [$(STAGE1)=False]: Add
ada/libgnat/s-imad32.o and ada/libgnat/s-imad64.o.
2024-06-13 Yannick Moy <moy@adacore.com>
* inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Do not inline
when constant with address clause is found.
2024-06-13 Ronan Desplanques <desplanques@adacore.com>
* gnatlink.adb (Gnatlink): Fix incorrect lower bound assumption.
(Is_Prefix): New function.
2024-06-13 Steve Baird <baird@adacore.com>
* sem_ch7.adb
(Requires_Completion_In_Body): Modify the Comes_From_Source test so that
the implicit declaration of an inherited subprogram does not cause
an incorrect result of True.
2024-06-13 Richard Kenner <kenner@adacore.com>
* exp_ch6.adb (Expand_Ctrl_Function_Call): Inline if -gnatn in
CCG mode even if -O0.
2024-06-13 Eric Botcazou <ebotcazou@adacore.com>
PR ada/114710
* exp_util.adb (Find_Renamed_Object): Recurse if the renamed object
is itself a renaming.
2024-06-13 Javier Miranda <miranda@adacore.com>
* sem_attr.adb (Analyze_Attribute): Enhance support for
using 'Old with a prefix that references an overloaded
function that has no parameters; add missing support
for the use of 'Old within qualified expressions.
* sem_util.ads (Preanalyze_And_Resolve_Without_Errors):
New subprogram.
* sem_util.adb (Preanalyze_And_Resolve_Without_Errors):
New subprogram.
2024-06-13 Piotr Trojanek <trojanek@adacore.com>
* layout.adb (Layout_Type): Use high-level wrapper routine.
* sem_ch13.adb (Inherit_Delayed_Rep_Aspects): Likewise.
* sem_ch3.adb (Analyze_Object_Declaration): Likewise.
2024-06-13 Eric Botcazou <ebotcazou@adacore.com>
* libgnat/s-tsmona__linux.adb (Get): Move down descriptive comment.
* libgnat/s-tsmona__mingw.adb: Add with clause and use clause for
System.Storage_Elements.
(Get): Pass GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT in the call
to GetModuleHandleEx and remove the subsequent call to FreeLibrary.
Upon success, set Load_Addr to the base address of the module.
* libgnat/s-win32.ads (GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS): Use
shorter literal.
(GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT): New constant.
2024-06-13 Eric Botcazou <ebotcazou@adacore.com>
PR ada/114710
* exp_ch7.adb (Build_Finalizer.Process_Declarations): Remove dead
code dealing with renamings.
* exp_util.ads (Is_Finalizable_Transient): Rename Rel_Node to N.
* exp_util.adb (Is_Finalizable_Transient): Likewise.
(Is_Aliased): Remove obsolete code dealing wih EWA nodes and only
consider renamings present in N itself.
(Requires_Cleanup_Actions): Remove dead code dealing with renamings.
2024-06-13 Javier Miranda <miranda@adacore.com>
* sem_ch13.adb (Analyze_One_Aspect): Set the applicable policy
of a type declaration when its aspect Dynamic_Predicate is
analyzed.
* sem_prag.adb (Handle_Dynamic_Predicate_Check): New subprogram
that enables or ignores dynamic predicate checks depending on
whether dynamic checks are enabled in the context where the
associated type declaration is defined; used in the analysis
of pragma check. In addition, for pragma Predicate, do not
disable it when the aspect was internally build as part of
processing a dynamic predicate aspect.
2024-06-12 Alexandre Oliva <oliva@adacore.com>
* gcc-interface/decl.cc (gnat_to_gnu_field): Use unpacked type
as the debug type for packed fields.
2024-06-10 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch4.adb (Expand_Nonbinary_Modular_Op): Create an explicit Mod
for additive operations if No_Implicit_Conditionals is in effect.
(Expand_Modular_Addition): Likewise.
(Expand_Modular_Subtraction): Likewise.
(Expand_Modular_Op): Always use an unsigned type obtained by calling
Small_Integer_Type_For on the required size.
2024-06-10 Javier Miranda <miranda@adacore.com>
* sem_ch6.adb (Might_Need_BIP_Task_Actuals): Add support
for access-to-subprogram parameter types.
* exp_ch6.adb (Add_Task_Actuals_To_Build_In_Place_Call):
Add dummy BIP parameters to access-to-subprogram types
that may reference a function that has BIP parameters.
2024-06-10 Gary Dismukes <dismukes@adacore.com>
* sem_prag.adb (Set_Convention_From_Pragma): If the specified convention on
a record type is not C_Pass_By_Copy, then force the C_Pass_By_Copy flag to
False, to ensure that it's overridden.
2024-06-10 Gary Dismukes <dismukes@adacore.com>
* sem_aggr.adb (Resolve_Iterated_Association): Change "not Present"
to "No" in test of Add_Named_Subp.
2024-06-10 Steve Baird <baird@adacore.com>
* freeze.adb
(Should_Freeze_Type.Is_Dispatching_Call_Or_Aggregate): Treat an extension
aggregate or a delta aggregate like a regular aggregate.
2024-06-10 Gary Dismukes <dismukes@adacore.com>
* sem_aggr.adb (Resolve_Iterated_Association): In the case of
N_Iterated_Element_Associations that have a key expression, issue
an error if the aggregate type does not have an Add_Named
operation, and include a reference to RM22 4.3.5(24) in the error
message. In the case of an N_Component_Association with a
Defining_Identifer where the "choice" is given by a function call,
in the creation of the iterator_specification associate a copy of
Choice as its Name, and remove the call to
Analyze_Iterator_Specification, which was causing problems with
the reanalysis of function calls originally given in prefixed form
that were transformed into function calls in normal (infix) form.
The iterator_specification will be analyzed later in any case, so
that call should not be done here. Remove the with and use of
Sem_Ch5.
2024-06-10 Justin Squirek <squirek@adacore.com>
* ali.adb (Get_Nat): Remove unnecessary parentheses.
* exp_ch11.adb (Expand_Local_Exception_Handlers): Remove
unnecessary parentheses.
* freeze.adb (Freeze_Entity): Remove unnecessary parentheses.
* lib-list.adb (List): Remove unnecessary parentheses.
* par-ch5.adb (P_Condition): Add extra parentheses checks on
condition operands.
* sem_ch3.adb (Add_Interface_Tag_Components): Remove unnecessary
parentheses.
(Check_Delta_Expression): Remove unnecessary parenthesis.
(Check_Digits_Expression): Remove unnecessary parentheses.
* sem_ch12.adb (Validate_Array_Type_Instance): Remove unnecessary
parentheses.
2024-06-10 Justin Squirek <squirek@adacore.com>
* exp_ch5.adb (Expand_Formal_Container_Element_Loop): Add
expansion of filter condition.
(Expand_Formal_Container_Loop): Add expansion of filter condition.
2024-06-10 Justin Squirek <squirek@adacore.com>
* accessibility.adb (Accessibility_Level): Use Get_Full_View to
avoid crashes when calculating scope.
2024-06-10 Justin Squirek <squirek@adacore.com>
* sem_warn.adb (Warn_On_Unreferenced_Entity): Add a condition to
ignore warnings on unreferenced abstract subprogram.
2024-06-10 Justin Squirek <squirek@adacore.com>
* sem_attr.adb (Analyze_Attribute): Add check for interface parent
types.
2024-06-10 Piotr Trojanek <trojanek@adacore.com>
* einfo.ads, exp_attr.adb, exp_ch4.adb, exp_ch7.adb,
lib-writ.adb, libgnat/a-stbuut.ads, sem_ch13.adb, sem_ch3.adb,
sem_ch7.adb: Use "RM" in comments.
2024-06-10 Piotr Trojanek <trojanek@adacore.com>
* sem_util.adb
(Immediate_Context_Implies_Is_Potentially_Unevaluated): Use
collective subtypes in membership tests.
(Is_Known_On_Entry): Require all alternatives in a case statement
to return; this change could prevent a recently fixed glitch,
where one of the alternatives relied on the return statement
afterwards (also, the new code is shorter).
* sem_util.ads (Is_Potentially_Unevaluated): Clarify that this
routine applies to Ada 2012.
2024-06-10 Yannick Moy <moy@adacore.com>
* libgnat/a-chtgfo.adb (Generic_Read, Generic_Write): Remove.
* libgnat/a-chtgfo.ads: Same. Remove dependency on Ada.Streams.
2024-06-10 Ronan Desplanques <desplanques@adacore.com>
* libgnarl/s-taprop__mingw.adb (Set_Task_Affinity): Fix usage of
SetThreadAffinityMask.
* libgnat/s-winext.ads (SetThreadAffinityMask): Fix binding
signature.
2024-06-10 Ronan Desplanques <desplanques@adacore.com>
* libgnarl/s-taprop__mingw.adb (Set_Task_Affinity): Fix usage
of SetThreadIdealProcessor.
2024-06-10 Ronan Desplanques <desplanques@adacore.com>
* libgnat/s-os_lib.adb (Normalize_Pathname): Remove incorrect
assert statement.
(Missed_Drive_Letter): Rename into...
(Drive_Letter_Omitted): This.
2024-06-10 Ronan Desplanques <desplanques@adacore.com>
* gnatlink.adb (Check_File_Name): Fix incorrect assumption.
2024-06-10 Piotr Trojanek <trojanek@adacore.com>
* exp_attr.adb (Expand_N_Attribute_Reference): Use constants
declared at the beginning of subprogram; tune layout.
* exp_ch3.adb (Predefined_Primitive_Bodies): Tune layout.
2024-06-10 Piotr Trojanek <trojanek@adacore.com>
* doc/gnat_rm/implementation_defined_pragmas.rst
(No_Tagged_Streams): Move documentation.
* doc/gnat_rm/standard_and_implementation_defined_restrictions.rst
(No_Streams): Likewise.
* exp_disp.adb (Make_DT): Extend comment.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2024-06-10 Piotr Trojanek <trojanek@adacore.com>
* sem_attr.adb (Analyze_Attribute): Use fully qualified name
without a NUL, so that it doesn't need to be skipped afterwards.
2024-06-10 Piotr Trojanek <trojanek@adacore.com>
* exp_ch3.adb (Stream_Operation_OK): Check restriction
No_Default_Stream_Attributes before call to
Type_Without_Stream_Operation.
* sem_util.adb (Type_Without_Stream_Operation): Remove static
condition from recursive routine
2024-06-10 Piotr Trojanek <trojanek@adacore.com>
* inline.adb (Has_Single_Return_In_GNATprove_Mode): Remove.
(Process_Formals): When rewriting an occurrence of a formal
parameter, use location of the occurrence, not of the inlined
call.
2024-06-10 Piotr Trojanek <trojanek@adacore.com>
* debug.adb (d_k): Use first available debug switch.
* gnat1drv.adb (Adjust_Global_Switches): If new debug switch is
active then don't expand assertion expressions by default.
2024-06-10 Piotr Trojanek <trojanek@adacore.com>
* exp_ch6.adb (Install_Class_Preconditions_Check): Refactor
common code for checking if precondition fails, since the
difference is only in raising an exception or calling the
Raise_Assert_Failure procedure.
2024-06-10 Piotr Trojanek <trojanek@adacore.com>
* exp_ch6.adb (Build_Dynamic_Check_Helper_Call): Remove unused
iteration over formal parameters.
2024-06-10 Piotr Trojanek <trojanek@adacore.com>
* sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Make
discriminants visible when analyzing aspect Interrupt_Priority.
(Freeze_Entity_Checks): Likewise.
(Resolve_Aspect_Expressions): Likewise for both aspects CPU and
Interrupt_Priority.
2024-06-10 Piotr Trojanek <trojanek@adacore.com>
* sem_prag.adb (Report_Extra_Clauses): Remove redundant check
for empty list, because First works also for No_List.
2024-06-10 Piotr Trojanek <trojanek@adacore.com>
* sem_prag.adb (Check_Dependency_Clause, Check_Output_States,
Report_Extra_Clauses): Remove multiple checks for being inside
an instance.
(Analyze_Refined_Depends_In_Decl_Part): Add single check for
being inside an instance.
2024-06-10 Piotr Trojanek <trojanek@adacore.com>
* sem_prag.adb (Check_In_Out_States, Check_Input_States,
Check_Output_States, Check_Proof_In_States,
Check_Refined_Global_List, Report_Extra_Constituents,
Report_Missing_Items): Remove multiple checks for being inside
an instance.
(Analyze_Refined_Global_In_Decl_Part): Add single check for
being inside an instance.
2024-06-05 Kewen Lin <linkw@linux.ibm.com>
* gcc-interface/decl.cc (gnat_to_gnu_entity): Use TYPE_PRECISION of
long_double_type_node to replace LONG_DOUBLE_TYPE_SIZE.
2024-05-29 Eric Botcazou <ebotcazou@adacore.com>
PR ada/115270
* Makefile.rtl (PowerPC/Linux): Use libgnat/s-atopri__32.ads for
the 32-bit library.
(SPARC/Linux): Likewise.
2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
PR ada/115168
* libgnarl/s-taprop__solaris.adb (Initialize): Fix pasto.
* libgnat/s-oslock__solaris.ads (Owner_Int): Delete.
(Owner_ID): Change the designated type to Integer.
2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/utils2.cc (nonbinary_modular_operation): Rewrite.
Do not create signed types for subtraction, do not create types with
partial precision, call fold_convert instead of convert throughout.
2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.cc (gnat_to_gnu_entity): Use the Is_Base_Type
predicate and remove superfluous calls to Base_Type.
2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/utils2.cc (gnat_protect_expr): Deal specifically
with atomic loads. Document the relationship with gnat_save_expr.
2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Array_Type>: For a
packed type implemented specially, temporarily save the XUA type as
equivalent to the entity before processing the implementation type.
For this implementation type, if its component type is the same as
that of the original type, copy the alias set from the latter.
<types>: Resort to universal aliasing for all interface types.
* gcc-interface/trans.cc (Call_to_gnu): Add GNU_ACTUAL_TYPE local
variable and rename existing one to GNU_UNPADDED_ACTUAL_TYPE.
If the formal is passed by reference and the actual is a conversion,
call aliasable_p to detect aliasing violations, issue a warning upon
finding one and create the temporary in the target type.
Add an assertion that no such violation has been missed above.
(addressable_p): Revert latest changes.
(aliasable_p): New predicate.
* gcc-interface/utils2.cc (build_binary_op) <ARRAY_RANGE_REF>: When
creating a new array type on the fly, preserve the alias set of the
operation type.
2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.cc (gnat_to_gnu) <N_Simple_Return_Statement>:
In the return-by-invisible-reference case, remove conversions before
looking for a dereference in the return values and building the test
protecting against a useless copy operation.
2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Array_Type>: Set
TYPE_TYPELESS_STORAGE on the array types if Universal_Aliasing is
set on the type or its component type.
<E_Array_Subtype>: Likewise.
For other aggregate types, set TYPE_TYPELESS_STORAGE in this case.
(set_typeless_storage_on_aggregate_type): New function.
(set_universal_aliasing_on_type): Likewise.
* gcc-interface/trans.cc (Call_to_gnu): Add const to local variable.
Adjust comment. Pass GNAT_NAME in the call to addressable_p and add
a bypass for atomic types in case it returns false.
(addressable_p): Add GNAT_EXPR third parameter with default value
and add a default value to the existing second parameter.
<VIEW_CONVERT_EXPR:>: Return false if the expression comes from a
function call and if the alias sets of source and target types are
both distinct from zero and each other.
2024-05-21 Ronan Desplanques <desplanques@adacore.com>
* gcc-interface/utils2.cc (build_cond_expr): Also apply an
indirection when the result type is variable-sized.
2024-05-21 Marc Poulhiès <poulhies@adacore.com>
* gcc-interface/decl.cc: Fix typo in comment.
2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/utils2.cc (build_call_alloc_dealloc_proc): Add an
assertion that this is not a deallocation of the return or secondary
stack and remove subsequent unreachable code.
2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/utils2.cc (build_cond_expr): Use the indirect path
for all types containing a placeholder.
2024-05-21 Piotr Trojanek <trojanek@adacore.com>
* gcc-interface/Make-lang.in (GNATBIND_OBJS): Remove unused
dependencies.
2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Variable>: Give a
warning for a statically allocated object whose size is constant,
valid but too large.
(allocatable_size_p): In the static case, return false for a size
that is constant, valid but too large.
2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Variable>: For an
array allocated with its bounds, make sure to have an array type
to build the template.
2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.cc (access_attribute_p): New predicate.
(lvalue_required_for_attribute_p): Return again 1 for Size and add
the missing terminating call to gcc_unreachable.
(gnat_to_gnu): Return the result unmodified for a reference to an
unconstrained array only if it is the prefix of an access attribute.
2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/utils.cc (relate_alias_sets): Restore previous code
when the type uses structural equality.
2024-05-21 Steve Baird <baird@adacore.com>
* exp_util.adb (Remove_Side_Effects): Make_Reference assumes that
the referenced object satisfies the constraints of the designated
subtype of the access type. Ensure that this assumption holds by
introducing a qualified expression if needed (and then ensuring
that checking associated with evaluation of the qualified
expression is not suppressed).
2024-05-21 Piotr Trojanek <trojanek@adacore.com>
* aspects.ads (Nonoverridable_Aspect_Id): Fix layout.
2024-05-21 Ronan Desplanques <desplanques@adacore.com>
* frontend.adb (Frontend): Remove duplicate statement.
2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
* sem_ch13.adb (Validate_Unchecked_Conversion): Restrict forcing the
Can_Use_Internal_Rep flag to platforms that require unnesting.
2024-05-21 Viljar Indus <indus@adacore.com>
* sem_elab.adb: Add missing elaboration insertion
characters to info messages.
2024-05-21 Piotr Trojanek <trojanek@adacore.com>
* inline.adb (Add_Scope_To_Clean): Use Append_Unique_Elmt.
(Analyze_Inlined_Bodies): Refine type of a local counter;
remove extra whitespace.
2024-05-21 Ronan Desplanques <desplanques@adacore.com>
* libgnarl/s-taenca.adb (Wait_For_Completion): Remove call to
Yield.
* libgnarl/s-tasren.adb (Timed_Selective_Wait, Wait_For_Call):
Remove calls to Yield.
2024-05-21 Piotr Trojanek <trojanek@adacore.com>
* doc/gnat_rm/implementation_of_ada_2012_features.rst:
Fix formatting.
* gnat_rm.texi: Regenerate.
2024-05-21 Piotr Trojanek <trojanek@adacore.com>
* doc/gnat_rm/implementation_of_ada_2012_features.rst:
Order list by AI number.
* gnat_rm.texi: Regenerate.
2024-05-21 Piotr Trojanek <trojanek@adacore.com>
* doc/gnat_rm/implementation_of_ada_2012_features.rst
(AI-0216): Fix index reference.
* gnat_rm.texi: Regenerate.
2024-05-21 Viljar Indus <indus@adacore.com>
* doc/gnat_ugn/building_executable_programs_with_gnat.rst:
Update the documentation of -gnatw.n and -gnatw.l
* gnat_ugn.texi: Regenerate.
2024-05-21 Piotr Trojanek <trojanek@adacore.com>
* doc/gnat_rm/implementation_defined_pragmas.rst
(No_Tagged_Streams): Document how to avoid exposing entity names
for the entire partition.
* exp_disp.adb (Make_DT): Make use of restriction No_Streams.
* exp_put_image.adb (Build_Record_Put_Image_Procedure): Respect
Discard_Names in the generated Put_Image procedure.
* gnat_rm.texi: Regenerate.
2024-05-21 Piotr Trojanek <trojanek@adacore.com>
* exp_put_image.adb (Build_Record_Put_Image_Procedure): Remove
useless conversions.
2024-05-21 Piotr Trojanek <trojanek@adacore.com>
* exp_put_image.adb (Build_Record_Put_Image_Procedure): Remove
trailing NUL from the fully qualified type name.
2024-05-21 Eric Botcazou <ebotcazou@adacore.com>
* err_vars.ads (Error_Msg_Sloc): Initialize to No_Location.
2024-05-21 Justin Squirek <squirek@adacore.com>
* doc/gnat_ugn/platform_specific_information.rst: Add note about
different priority level granularities under different policies in
Windows and move POSIX related info into new section.
* libgnarl/s-taprop.ads: Add note about Task_Dispatching_Policy.
* libgnarl/s-taprop__mingw.adb:
(Set_Priority): Add use of Non_FIFO_Underlying_Priorities.
* libgnat/system-mingw.ads: Add documentation for modifying
priority mappings and add alternative mapping
Non_FIFO_Underlying_Priorities.
* gnat_ugn.texi: Regenerate.
2024-05-20 Bob Duff <duff@adacore.com>
* sem_ch12.adb: Misc cleanups and comment fixes.
(Check_Overloaded_Formal_Subprogram): Remove the Others_Choice
error message.
(Others_Choice): Remove this variable; no longer needed.
* types.ads (Text_Ptr): Add a range constraint limiting the
subtype to values that are actually used. This has the advantage
that when the compiler is compiled with validity checks,
uninitialized values of subtypes Text_Ptr and Source_Ptr will be
caught.
* sinput.ads (Sloc_Adjust): Use the base subtype; this is used as
an offset, so we need to allow arbitrary negative values.
2024-05-20 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch7.ads (Preload_Finalization_Collection): Delete.
* exp_ch7.adb (Allows_Finalization_Collection): Revert change.
(Preload_Finalization_Collection): Delete.
* opt.ads (Interface_Seen): Likewise.
* scng.adb (Scan): Revert latest change.
* sem_ch10.adb: Remove clause for Exp_Ch7.
(Analyze_Compilation_Unit): Revert latest change.
* libgnat/i-c.ads: Use a fully qualified name for the standard "+"
operator in the preconditons/postconditions of subprograms.
2024-05-20 Eric Botcazou <ebotcazou@adacore.com>
* exp_aggr.adb (Expand_Record_Aggregate.Component_OK_For_Backend):
Also return False for a delayed conditional expression.
2024-05-20 Eric Botcazou <ebotcazou@adacore.com>
* freeze.ads (Check_Compile_Time_Size): Remove obsolete description
of usage for the Size_Known_At_Compile_Time flag.
* freeze.adb (Check_Compile_Time_Size.Size_Known): In the case where
a variant part is present, do not return False if Esize is known.
* sem_util.adb (Needs_Secondary_Stack.Caller_Known_Size_Record): Add
missing "Start of processing" comment. Return true if either a size
clause or an object size clause has been given for the first subtype
of the type.
2024-05-20 Bob Duff <duff@adacore.com>
* sinfo.ads: Misc comment corrections and clarifications.
The syntax for GENERIC_ASSOCIATION and FORMAL_PACKAGE_ACTUAL_PART
was wrong.
Emphasize that "others => <>" is not represented as an
N_Generic_Association (with or without Box_Present set),
and give examples illustrating the various possibilities.
2024-05-20 Eric Botcazou <ebotcazou@adacore.com>
* einfo-utils.ads (Is_Base_Type): Move to Miscellaneous Subprograms
section and add description.
* fe.h (Is_Base_Type): Declare.
2024-05-20 Gary Dismukes <dismukes@adacore.com>
* sem_aggr.adb (Resolve_Aggregate): Move condition and call for
Resolve_Record_Aggregate in front of code related to calling
Resolve_Container_Aggregate (and add test that the aggregate is
not homogeneous), and remove special-case testing and call to
Resolve_Container_Aggregate for empty aggregates. Also, add error
check for an attempt to use "[]" for an aggregate of a record type
that does not specify an Aggregate aspect.
(Resolve_Record_Aggregate): Remove error check for record
aggregates with "[]" (now done by Resolve_Aggregate).
2024-05-20 Gary Dismukes <dismukes@adacore.com>
* sem_aggr.adb (Resolve_Aggregate): Move condition and call for
Resolve_Record_Aggregate in front of code related to calling
Resolve_Container_Aggregate (and add test that the aggregate
is not homogeneous), and remove special-case testing and call
to Resolve_Container_Aggregate for empty aggregates.
2024-05-20 Justin Squirek <squirek@adacore.com>
* accessibility.adb (Accessibility_Level): Add cases for 'First
and 'Last.
2024-05-20 Justin Squirek <squirek@adacore.com>
* sem_attr.adb (Analyze_Attribute): Remove restriction on 'Super
for abstract types.
2024-05-20 Piotr Trojanek <trojanek@adacore.com>
* sem_attr.ads (Attribute_Impl_Def): Fix list of
implementation-defined attributes.
2024-05-20 Piotr Trojanek <trojanek@adacore.com>
* sem_attr.adb (Attribute_12): Add attributes Old,
Overlaps_Storage and Result.
2024-05-20 Piotr Trojanek <trojanek@adacore.com>
* sem_attr.adb (Analyze_Attribute): Move IF statement that
checks restriction No_Implementation_Attributes for Ada 2005,
2012 and Ada 2022 attributes inside Comes_From_Source condition
that checks the same restriction for Ada 83 attributes.
2024-05-20 Piotr Trojanek <trojanek@adacore.com>
* sem_attr.adb (Analyze_Attribute): Remove condition that is
already checked by an enclosing IF statement.
2024-05-20 Piotr Trojanek <trojanek@adacore.com>
* sem_attr.ads (Universal_Type_Attribute): Simplify using
array aggregate syntax with discrete choice list.
2024-05-20 Piotr Trojanek <trojanek@adacore.com>
* sem_attr.ads (Attribute_Impl_Def): Fix style in comment.
2024-05-20 Ronan Desplanques <desplanques@adacore.com>
* libgnarl/s-taprop__linux.adb (Enter_Task): Move setting
of thread ID out of Enter_Task.
(Initialize): Set thread ID for the environment task.
(Create_Task): Remove now unnecessary Unrestricted_Access
attribute and add justification for a memory write.
* libgnarl/s-taprop__posix.adb: Likewise.
* libgnarl/s-taprop__qnx.adb: Likewise.
* libgnarl/s-taprop__rtems.adb: Likewise.
* libgnarl/s-taprop__solaris.adb: Likewise.
* libgnarl/s-taspri__posix.ads: Remove pragma Atomic for
Private_Data.Thread, and update documentation comment.
* libgnarl/s-taspri__lynxos.ads: Likewise.
* libgnarl/s-taspri__posix-noaltstack.ads: Likewise.
* libgnarl/s-taspri__solaris.ads: Likewise.
* libgnarl/s-tporft.adb (Register_Foreign_Thread): Adapt to
Enter_Task not setting the thread ID anymore.
* libgnarl/s-tassta.adb (Task_Wrapper): Update comment.
2024-05-20 Eric Botcazou <ebotcazou@adacore.com>
* exp_aggr.ads (Is_Delayed_Conditional_Expression): New predicate.
* exp_aggr.adb (Convert_To_Assignments.Known_Size): Likewise.
(Convert_To_Assignments): Climb the parent chain, looking through
qualified expressions and dependent expressions of conditional
expressions, to find out whether the expansion may be delayed.
Call Known_Size for this in the case of an object declaration.
If so, set Expansion_Delayed on the aggregate as well as all the
intermediate conditional expressions.
(Initialize_Component): Reset the Analyzed flag on an initialization
expression that is a conditional expression whose expansion has been
delayed.
(Is_Delayed_Conditional_Expression): New predicate.
* exp_ch3.adb (Expand_N_Object_Declaration): Handle initialization
expressions that are conditional expressions whose expansion has
been delayed.
* exp_ch4.adb (Build_Explicit_Assignment): New procedure.
(Expand_Allocator_Expression): Handle initialization expressions
that are conditional expressions whose expansion has been delayed.
(Expand_N_Case_Expression): Deal with expressions whose expansion
has been delayed by waiting for the rewriting of their parent as
an assignment statement and then optimizing the assignment.
(Expand_N_If_Expression): Likewise.
(Expand_N_Qualified_Expression): Do not apply a predicate check to
an operand that is a delayed aggregate or conditional expression.
* gen_il-gen-gen_nodes.adb (N_If_Expression): Add Expansion_Delayed
semantic flag.
(N_Case_Expression): Likewise.
* sinfo.ads (Expansion_Delayed): Document extended usage.
2024-05-20 Gary Dismukes <dismukes@adacore.com>
* exp_aggr.adb (Expand_Container_Aggregate): Add top-level
variables Choice_{Lo|Hi} and Int_Choice_{Lo|Hi} used for
determining the low and high bounds of component association
choices. Replace code for determining whether we have an indexed
aggregate with call to new function Sem_Aggr.Is_Indexed_Aggregate.
Remove test of whether Empty_Subp is a function, since it must be
a function. Move Default and Count_Type to be locals of a new
block enclosing the code that creates the object to hold the
aggregate length, and set them according to the default and type
of the Empty function's parameter when present (and to Empty and
Standard_Natural otherwise). Use Siz_Exp for the aggregate length
when set, and use Empty's default length when available, and use
zero for the length otherwise. In generating the call to the
New_Indexed function, use the determined lower and upper bounds if
determined earlier by Aggregate_Size, and otherwise compute those
from the index type's lower bound and the determined aggregate
length. In the case where a call to Empty is generated and the
function has a formal parameter, pass the value saved in Siz_Decl
(otherwise the parameter list is empty). Remove code specific to
making a parameterless call to the Empty function. Extend the code
for handling positional container aggregates to account for types
that define Assign_Indexed, rather than just Add_Unnamed, and in
the case of indexed aggregates, create a temporary object to hold
values of the aggregate's key index, and initialize and increment
that temporary for each call generated to the Assign_Indexed
procedure. For named container aggregates that have key choices
given by ranges, call Expand_Range_Component to generate a loop
that will call the appropriate insertion procedure for each value
of the range. For indexed aggregates with a Component_Associations
list, set and use the Assign_Indexed procedure for each component
association, whether or not there's an iterator specification.
(Add_Range_Size): Add code to determine the low and high bounds of
the range and capture those in up-level variables when their value
is less than or greater than (respectively) the current minimum
and maximum bounds values.
(Aggregate_Size): Separately handle the case where a single choice
is of a discrete type, and call Add_Range_Size to take its value
into consideration for determination of min and max bounds of the
aggregate. Add comments in a couple of places.
(Build_Siz_Exp): Remove the last sentence and "???" from the
comment that talks about accumulating nonstatic sizes, since that
sentence seems to be obsolete. Record the low and high bound
values in Choice_Lo and Choice_Hi in the case of a nonstatic
range.
(Expand_Iterated_Component): Set the Defining_Identifier of the
iterator specification to the Loop_Id in the
N_Iterated_Component_Association case.
(Expand_Range_Component): Procedure unnested from the block
handling indexed aggregates in Expand_Container_Aggregate, and
moved to top level of that procedure so it can also be called for
Add_Named cases. A formal parameter Insert_Op is added, and
existing calls to this procedure are changed to pass the
appropriate insertion procedure's Entity.
* sem_aggr.ads: Add with_clause for Sinfo.Nodes.
(Is_Indexed_Aggregate): New function for use by
Resolve_Container_Aggregate and Expand_Container_Aggregate.
* sem_aggr.adb: Add with_clause for Sem_Ch5. Move with_clause for
Sinfo.Nodes to sem_aggr.ads.
(Is_Indexed_Aggregate): New function to determine whether a
container aggregate is a container aggregate (replacing local
variable of the same name in Resolve_Container_Aggregate).
(Resolve_Iterated_Association): Remove part of comment saying that
a Key_Expression is always present. Set Parent field of the copy
of a component association with a loop parameter specification. On
the setting of Loop_Param_Id, account for a
Loop_Parameter_Specification being changed into an
Iterator_Specification as a result of being analyzed. Only call
Preanalyze_And_Resolve on Key_Expr when a key expression is
actually present. Remove loop for handling choices for the case of
an N_Component_Association with a Defining_Identifier (there
shouldn't be more than one choice in this case, and add an
assertion to ensure that). Also add code here to handle the case
where the choice is a function call, creating an
iterator_specification analyzing it, and call
Resolve_Iterated_Association recursively to process it. Add error
check to enforce RM22 4.3.5(27), which requires that the type of
the loop parameter must be the same as the key type when there is
no key expression and the aggregate is an indexed aggregate or has
an Add_Named op.
(Resolve_Container_Aggregate): In the Add_Unnamed case, call
Resolve_Iterated_Association for both
N_Iterated_Element_Association and N_Component_Association (rather
than just the latter). Remove error check for nonstatic choices in
component associations in Add_Named cases (multiple named
nonstatic associations are fine except in indexed aggregates).
Remove local variable Is_Indexed_Aggregate, replaced with new
library-level function of the same name, and add test of
Is_Indexed_Aggregate in the case where the aggregate type has an
Assign_Indexed operation, as a guard for doing error checks for
indexed aggregates. For indexed aggregate resolution, do not call
Analyze_And_Resolve on the expression of an
N_Component_Association in the "box association" case. Move error
checks for indexed aggregates with iterated associations that flag
cases where an association is a loop_parameter_specification with
an iterator filter or a key expression (violation of RM22
4.3.5(28/5)), from the loop that checks for contiguous and
nonoverlapping choices and into the preceding association loop
after the call to Resolve_Iterated_Association. The RM reference
is added to the error-message strings.
2024-05-20 Ronan Desplanques <desplanques@adacore.com>
* libgnarl/s-taprop__linux.adb (Set_Task_Affinity): Fix
decision about whether to call CPU_FREE.
2024-05-20 Eric Botcazou <ebotcazou@adacore.com>
* exp_aggr.ads (Convert_Aggr_In_Allocator): Remove Aggr parameter
and adjust description.
(Convert_Aggr_In_Object_Decl): Adjust description.
* exp_aggr.adb (Convert_Aggr_In_Allocator): Remove Aggr parameter
and add local variable of the same name instead. Adjust call to
Convert_Array_Aggr_In_Allocator.
(Convert_Aggr_In_Object_Decl): Add comment for early return and
remove useless inner block statement.
(Convert_Array_Aggr_In_Allocator): Remove Aggr parameter and add
local variable of the same name instead.
(In_Place_Assign_OK): Move down declarations of local variables.
(Convert_To_Assignments): Put all declarations of local variables
in the same place. Fix typo in comment. Replace T with Full_Typ.
* exp_ch4.adb (Expand_Allocator_Expression): Call Unqualify instead
of Expression on the qualified expression of the allocator for the
sake of consistency. Adjust call to Convert_Aggr_In_Allocator.
2024-05-20 Piotr Trojanek <trojanek@adacore.com>
* sem_attr.adb (Eval_Attribute): Handle enumeration type with
Discard_Names.
2024-05-20 Piotr Trojanek <trojanek@adacore.com>
* exp_imgv.adb (Expand_Width_Attribute): Fix for 'Width that
is computed at run time.
* sem_attr.adb (Eval_Attribute): Fix for 'Width that is computed
at compilation time.
2024-05-20 Sebastian Poeplau <poeplau@adacore.com>
* libgnat/s-pooglo.adb (Allocate): Use arithmetic on
System.Address to compute the aligned address.
2024-05-20 Steve Baird <baird@adacore.com>
* freeze.adb (Adjust_Esize_For_Alignment): Assert that a valid
Alignment specification cannot result in adjusting the given
type's Esize to be larger than System_Max_Integer_Size.
* sem_ch13.adb (Analyze_Attribute_Definition_Clause): In analyzing
an Alignment specification, enforce the rule that a specified
Alignment value for a discrete or fixed-point type shall not be
larger than System_Max_Integer_Size / 8 .
2024-05-20 Eric Botcazou <ebotcazou@adacore.com>
* libgnat/g-sothco.ads (In_Addr): Add aspect Universal_Aliasing.
2024-05-20 Jose Ruiz <ruiz@adacore.com>
* sem_prag.adb (Analyze_Pragma): Exclude detection of duplicates
because they are detected elsewhere.
2024-05-20 Jose Ruiz <ruiz@adacore.com>
* exp_ch9.adb (Expand_N_Protected_Type_Declaration): Clarify
comments.
* sem_prag.adb (Analyze_Pragma): Check for duplicates
Max_Entry_Queue_Length, Max_Entry_Queue_Depth and Max_Queue_Length
for the same protected entry.
* sem_util.adb (Get_Max_Queue_Length): Take into account all three
representation aspects that can be used to set this restriction.
(Has_Max_Queue_Length): Likewise.
* doc/gnat_rm/implementation_defined_pragmas.rst:
(pragma Max_Queue_Length): Fix pragma in example.
* gnat_rm.texi: Regenerate.
2024-05-20 Eric Botcazou <ebotcazou@adacore.com>
* libgnat/s-finpri.ads (Collection_Node): Move to private part.
(Collection_Node_Ptr): Likewise.
(Header_Alignment): Change to declaration and move completion to
private part.
(Header_Size): Likewise.
(Lock_Type): Delete.
(Finalization_Collection): Move Lock component and remove default
value for Finalization_Started component.
* libgnat/s-finpri.adb (Initialize): Reorder statements.
2024-05-20 Eric Botcazou <ebotcazou@adacore.com>
* doc/gnat_rm/implementation_defined_pragmas.rst
(Universal_Aliasing): Remove reference to No_Strict_Aliasing.
* doc/gnat_ugn/gnat_and_program_execution.rst
(Optimization and Strict Aliasinng): Simplify first example and
make it more consistent with the second. Add description of the
effects of pragma Universal_Aliasing and document new warning
issued for unchecked conversions. Remove obsolete stuff.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2024-05-17 Eric Botcazou <ebotcazou@adacore.com>
PR ada/115133
* libgnarl/s-osinte__solaris.ads (mutex_t): Fix typo.
* libgnarl/s-taprop__solaris.adb (Record_Lock): Add conversion.
(Check_Sleep): Likewise.
(Record_Wakeup): Likewise.
(Check_Unlock): Likewise.
* libgnarl/s-tasini.adb (Initialize_RTS_Lock): Add pragma Import
on the overlaid variable.
(Finalize_RTS_Lock): Likewise.
(Acquire_RTS_Lock): Likewise.
(Release_RTS_Lock): Likewise.
* libgnarl/s-taspri__solaris.ads (To_RTS_Lock_Ptr): New instance
of Ada.Unchecked_Conversion.
* libgnat/s-oslock__solaris.ads: Add with clause for
Ada.Unchecked_Conversion.
(array_type_9): Add missing name qualification.
(record_type_3): Likewise.
(mutex_t): Fix formatting.
2024-05-17 Viljar Indus <indus@adacore.com>
* exp_aggr.adb (Expand_Container_Aggregate):
Derive the size for iterable aggregates in the case of
one-dimensional array objects.
2024-05-17 Ronan Desplanques <desplanques@adacore.com>
* exp_aggr.adb (Aggr_Size_OK): Remove workaround and extend
comment.
2024-05-17 Eric Botcazou <ebotcazou@adacore.com>
* bindgen.adb (Gen_Adainit): Generate declaration and call to the
imported procedure __gnat_tasking_runtime_initialize if need be.
* libgnat/s-soflin.ads (Locking Soft-Links): Add commentary.
* libgnarl/s-tasini.adb (Tasking_Runtime_Initialize): New procedure
exported as __gnat_tasking_runtime_initialize. Initialize RTS_Lock
manipulation routines here instead of...
(Init_RTS): ...here.
2024-05-17 Steve Baird <baird@adacore.com>
* scng.adb (scan): When checking for an unprocessed preprocessor
directive, take into account the preprocessor's rules about case
insensitivity and about white space between the '#' and the
keyword.
2024-05-17 Eric Botcazou <ebotcazou@adacore.com>
* libgnarl/s-taspri__mingw.ads: Add clause for System.OS_Interface.
(Private_Data): Change type of Thread component.
2024-05-17 Eric Botcazou <ebotcazou@adacore.com>
* libgnat/g-alvevi.ads: Add pragma Universal_Aliasing for all the
view types.
* libgnat/s-stratt.ads: Likewise for Fat_Pointer type.
2024-05-17 Eric Botcazou <ebotcazou@adacore.com>
* Makefile.rtl (GNATRTL_NONTASKING_OBJS): Add s-oslock$(objext).
(LIBGNAT_TARGET_PAIRS): Use s-oslock__dummy.ads by default.
Set specific s-oslock.ads source file for all the platforms.
* exp_ch7.ads (Preload_Finalization_Collection): New procedure.
* exp_ch7.adb (Allows_Finalization_Collection): Return False if
System.Finalization_Primitives has not been preloaded.
(Preload_Finalization_Collection): New procedure.
* opt.ads (Interface_Seen): New boolean variable.
* s-oscons-tmplt.c: Use "N" string for pragma Style_Checks.
* scng.adb (Scan): Set Interface_Seen upon seeing "interface".
* sem_ch10.adb: Add clause for Exp_Ch7.
(Analyze_Compilation_Unit): Call Preload_Finalization_Collection
after the context of the unit is analyzed.
* libgnarl/a-rttiev.adb: Add with clause for System.OS_Locks and
alphabetize others.
(Event_Queue_Lock): Adjust qualified name of subtype.
* libgnarl/s-osinte__aix.ads: Add with clause for System.OS_Locks
and change pthread_mutex_t into a local subtype.
* libgnarl/s-osinte__android.ads: Likewise.
* libgnarl/s-osinte__darwin.ads: Likewise.
* libgnarl/s-osinte__dragonfly.ads: Likewise.
* libgnarl/s-osinte__freebsd.ads: Likewise.
* libgnarl/s-osinte__gnu.ads: Likewise.
* libgnarl/s-osinte__hpux-dce.ads: Likewise.
* libgnarl/s-osinte__hpux.ads: Add Likewise.
* libgnarl/s-osinte__kfreebsd-gnu.ads: Likewise.
* libgnarl/s-osinte__linux.ads: Likewise.
* libgnarl/s-osinte__lynxos178e.ads: Likewise.
* libgnarl/s-osinte__qnx.ads: Likewise.
* libgnarl/s-osinte__rtems.ads: Likewise.
* libgnarl/s-osinte__mingw.ads: Add with clause for System.OS_Locks
and change CRITICAL_SECTION into a local subtype. Add declarations
for imported procedures dealing with CRITICAL_SECTION.
* libgnarl/s-osinte__solaris.ads: Add with clause for System.OS_Locks
and change mutex_t into a local subtype.
* libgnarl/s-osinte__vxworks.ads: Add missing blank line.
* libgnarl/s-taprop.ads: Alphabetize clauses and package renamings.
Use qualified name for RTS_Lock throughout.
* libgnarl/s-taprop__dummy.adb: Add use clause for System.OS_Locks
and alphabetize others.
* libgnarl/s-taprop__hpux-dce.adb: Likewise.
* libgnarl/s-taprop__linux.adb: Likewise.
* libgnarl/s-taprop__posix.adb: Likewise.
* libgnarl/s-taprop__qnx.adb: Likewise.
* libgnarl/s-taprop__rtems.adb: Likewise.
* libgnarl/s-taprop__solaris.adb: Likewise.
* libgnarl/s-taprop__vxworks.adb: Likewise.
* libgnarl/s-taprop__mingw.adb: Likewise. Remove declarations for
imported procedures dealing with CRITICAL_SECTION.
* libgnarl/s-tarest.adb: Add with clause for System.OS_Locks and
alphabetize others.
(Global_Task_Lock): Adjust qualified name of subtype.
* libgnarl/s-tasini.adb: Add clause for System.OS_Locks.
(Initialize_RTS_Lock): New procedure.
(Finalize_RTS_Lock): Likewise.
(Acquire_RTS_Lock): Likewise.
(Release_RTS_Lock): Likewise.
(Init_RTS): Add compile-time assertions for RTS_Lock types.
Set the soft links for the RTS lock manipulation routines.
* libgnarl/s-taspri__dummy.ads: Add with clause for System.OS_Locks.
(RTS_Lock): Delete and adjust throughout accordingly.
* libgnarl/s-taspri__hpux-dce.ads: Likewise.
* libgnarl/s-taspri__lynxos.ads: Likewise.
* libgnarl/s-taspri__mingw.ads: Likewise.
* libgnarl/s-taspri__posix-noaltstack.ads: Likewise.
* libgnarl/s-taspri__posix.ads: Likewise.
* libgnarl/s-taspri__solaris.ads: Likewise.
* libgnarl/s-taspri__vxworks.ads: Likewise.
* libgnat/s-finpri.ads: Add clause for System.OS_Locks.
(Finalization_Collection): Change type of Lock.
* libgnat/s-finpri.adb (Initialize): Call Initialize_RTS_Lock.
(Lock_Collection): Call Acquire_RTS_Lock.
(Unlock_Collection): Call Release_RTS_Lock.
* libgnat/s-oslock__dummy.ads: New file.
* libgnat/s-oslock__hpux-dce.ads: Likewise.
* libgnat/s-oslock__mingw.ads: Likewise.
* libgnat/s-oslock__posix.ads: Likewise.
* libgnat/s-oslock__solaris.ads: Likewise.
* libgnat/s-oslock__vxworks.ads: Likewise.
* libgnat/s-soflin.ads (Null_Set_Address): New null procedure.
(Initialize_RTS_Lock): New soft link.
(Finalize_RTS_Lock): Likewise.
(Acquire_RTS_Lock): Likewise.
(Release_RTS_Lock): Likewise.
* exp_ch4.adb (Expand_N_Allocator): In the subtype indication case,
call Apply_Predicate_Check on the resulting access value if need be.
2024-05-17 Eric Botcazou <ebotcazou@adacore.com>
* einfo.ads (Materialize_Entity): Document secondary usage.
2024-05-17 Steve Baird <baird@adacore.com>
* local_restrict.adb (Active_Restriction): When traversing scopes,
do not skip over a subprogram body.
2024-05-17 Eric Botcazou <ebotcazou@adacore.com>
* libgnarl/s-taprop__dummy.adb (Initialize_Lock): Fix formatting.
* libgnarl/s-taprop__linux.adb (RTS_Lock_Ptr): Delete.
(Init_Mutex): Rename into...
(Initialize_Lock): ...this.
(Initialize_Lock [Lock]): Call above procedure.
(Initialize_Lock [RTS_Lock]): Likewise.
(Initialize_TCB): Likewise.
* libgnarl/s-taprop__posix.adb (Initialize_Lock): New procedure
factored out from the other two homonyms.
(Initialize_Lock [Lock]): Call above procedure.
(Initialize_Lock [RTS_Lock]): Likewise.
* libgnarl/s-taprop__qnx.adb (RTS_Lock_Ptr): Delete.
(Init_Mutex): Rename into...
(Initialize_Lock): ...this.
(Initialize_Lock [Lock]): Call above procedure.
(Initialize_Lock [RTS_Lock]): Likewise.
(Initialize_TCB): Likewise.
* libgnarl/s-taprop__rtems.adb (Initialize_Lock): New procedure
factored out from the other two homonyms.
(Initialize_Lock [Lock]): Call above procedure.
(Initialize_Lock [RTS_Lock]): Likewise.
2024-05-17 Piotr Trojanek <trojanek@adacore.com>
* sem_util.adb (Is_Known_On_Entry): Handle constants introduced
by validity checks.
2024-05-17 Steve Baird <baird@adacore.com>
* libgnat/a-direct.adb (Start_Search_Internal): Do not call
Modification_Time for a special file; declare a Calendar.Time
constant No_Time and use that instead.
2024-05-17 Steve Baird <baird@adacore.com>
* exp_ch3.adb (Build_Equivalent_Record_Aggregate): Add
Has_Predicates test for a scalar component to match what is
already done for other kinds of components.
2024-05-17 Ronan Desplanques <desplanques@adacore.com>
* sem_aggr.adb (Resolve_Array_Aggregate): Improve comments
and condition.
2024-05-17 Ronan Desplanques <desplanques@adacore.com>
* sem_aggr.adb (Resolve_Array_Aggregate): Fix location of error
message.
2024-05-17 Piotr Trojanek <trojanek@adacore.com>
* sem_prag.adb (Is_Unconstrained_Or_Tagged_Item): Move to
Sem_Util, so it can be used from GNATprove.
* sem_util.ads (Is_Unconstrained_Or_Tagged_Item): Move from
Sem_Prag; spec.
* sem_util.adb (Is_Unconstrained_Or_Tagged_Item): Move from
Sem_Prag; body.
2024-05-17 Eric Botcazou <ebotcazou@adacore.com>
* exp_pakd.adb (Create_Packed_Array_Impl_Type): For non-bit-packed
array types, propagate the aliased property of the component.
(Install_PAT): Set fields on the implicit base type of an array.
* libgnat/a-stream.ads (private part): Add pragma Universal_Aliasing
for Stream_Element.
* libgnat/g-alleve.ads: Add pragma Universal_Aliasing for all the
vector types.
* libgnat/g-alleve__hard.ads: Likewise.
2024-05-17 Bob Duff <duff@adacore.com>
* bcheck.adb (Check_Consistency_Of_Sdep): Split out new procedure.
Add check for special case of subprogram spec that no longer
exists.
(Check_Consistency): Call Check_Consistency_Of_Sdep, except when
Reified_Child_Spec is True. No need for "goto Continue" or "exit
Sdep_Loop".
* ali.ads (Subunit_Name, Unit_Name): Change the type to
Unit_Name_Type. Add a comment pointing to the ALI file
documentation, because it's in a somewhat-surprising place.
* ali.adb (Scan_ALI): Subunit_Name and Unit_Name are now
Unit_Name_Type. Remove comment explaining why Name_Find is used;
Name_Find is the usual case. Do not remove the "%s" or "%b" from
the Unit_Name. We need to be able to distinguish specs and bodies.
This is also necessary to obey the invariant of Unit_Name_Type.
* binde.adb (Write_Closure): Subunit_Name is now Unit_Name_Type.
* clean.adb (Clean_Executables): Likewise.
2024-05-17 Ronan Desplanques <desplanques@adacore.com>
* sem_aggr.adb (Resolve_Null_Array_Aggregate): Update
documentation comments.
2024-05-17 Steve Baird <baird@adacore.com>
* sem_util.adb (Has_Some_Controlled_Component): Fix a bug which
causes (in some cases involving a Disable_Controlled aspect
specification) Needs_Finalization to return different answers for
one type depending on whether the function is called before or
after the type is frozen.
* libgnat/a-coorse.ads: Type Control_Reference_Type gets an Adjust
procedure.
* libgnat/a-cborse.ads: Likewise.
* libgnat/a-ciorse.ads: Likewise
* libgnat/a-coorse.adb:
(Finalize): Reclaim allocated Key_Type object.
(Adjust): New procedure; prevent sharing of non-null Key_Access
values by allocating a copy.
* libgnat/a-cborse.adb: Likewise.
* libgnat/a-ciorse.adb: Likewise.
2024-05-17 Bob Duff <duff@adacore.com>
* uname.adb (Get_Unit_Name_String): Move Asserts after
Buf is initialized.
2024-05-17 Bob Duff <duff@adacore.com>
* ali-util.adb (Read_Withed_ALIs): Minor reformatting.
* bindo-units.adb (Corresponding_Body): Add assert.
(Corresponding_Spec): Likewise.
* uname.adb: Clean up assertions, use available functions.
Get_Spec_Name/Get_Body_Name can assert that N obeys the
conventions for Unit_Name_Type (end in "%s" or "%b").
2024-05-17 Sebastian Poeplau <poeplau@adacore.com>
* raise-gcc.c: Work around __builtin_code_address_from_pointer
if it is unavailable.
2024-05-17 Marc Poulhiès <poulhies@adacore.com>
* exp_aggr.adb (Build_Array_Aggr_Code) <Gen_Loop>: Copy the
initialization expression when unrolling the loop.
2024-05-17 Bob Duff <duff@adacore.com>
* sem_disp.adb (Check_Dispatching_Operation): Call
Create_Extra_Formals, so that the caller will have an extra
"constrained" parameter, which will be checked on assignment in
the callee, and will be passed in by the caller.
2024-05-17 Piotr Trojanek <trojanek@adacore.com>
* sem_prag.adb (Is_Unconstrained_Or_Tagged_Item): Remove call
to Has_Discriminants; combine ELSIF branches.
2024-05-17 Piotr Trojanek <trojanek@adacore.com>
* sem_ch7.adb (New_Private_Type): Simplify setting of
Is_Constrained flag.
* sem_prag.adb (Is_Unconstrained_Or_Tagged_Item): Simplify
detection of private types with no discriminant.
2024-05-17 Piotr Trojanek <trojanek@adacore.com>
* sem_prag.adb (Is_Unconstrained_Or_Tagged_Item): Allow objects
of private types with unknown discriminants.
2024-05-17 Piotr Trojanek <trojanek@adacore.com>
* sem_prag.adb (Is_Unconstrained_Or_Tagged_Item): Tune repeated
testing of type kinds.
2024-05-17 Marc Poulhiès <poulhies@adacore.com>
* doc/gnat_rm/implementation_defined_attributes.rst: Fix
copy/paste.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2024-05-17 Viljar Indus <indus@adacore.com>
* sem_ch3.adb (Analyze_Component_Declaration):
Apply range checks only for Scalar_Types to
ensure that they have the Scalar_Range attribute.
2024-05-17 Viljar Indus <indus@adacore.com>
* sem_ch3.adb (Analyze_Component_Declaration):
Add Range_Checks for Subtype_Indications
2024-05-17 Ronan Desplanques <desplanques@adacore.com>
* exp_ch4.adb (Expand_N_Case_Expression): Remove call to
Relocate_Node.
* sem_attr.adb (Analyze_Attribute): Likewise.
2024-05-17 Ronan Desplanques <desplanques@adacore.com>
* exp_aggr.adb (Flatten): Small cleanup.
2024-05-17 Eric Botcazou <ebotcazou@adacore.com>
* sem_attr.adb (Analyze_Attribute) <Attribute_Size>: Remove special
processing for pragma Compile_Time_{Warning,Error}.
(Eval_Attribute.Compile_Time_Known_Attribute): Set Is_Static on the
resulting value if In_Compile_Time_Warning_Or_Error is set.
(Eval_Attribute.Full_Type): New helper function.
(Eval_Attribute): Call Full_Type for type attributes. Add handling
of Object_Size and adjust that of Max_Size_In_Storage_Elements in
the non-static case.
2024-05-16 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch7.adb (Attach_Object_To_Master_Node): Remove reference to a
transient object in comment.
2024-05-16 Marc Poulhiès <poulhies@adacore.com>
* exp_ch7.adb (Reset_Scopes_To_Block_Elab_Proc): also reset scope
for object declarations.
2024-05-16 Steve Baird <baird@adacore.com>
* checks.adb (Expr_Known_Valid): Return True for a static expression.
* exp_util.adb (Adjust_Condition): No validity check needed for a
condition if it is an expression for which a validity check has
already been generated.
2024-05-16 Gary Dismukes <dismukes@adacore.com>
* libgnat/a-coinve.ads (type Vector): In the Aggregate aspect for
this type, the Empty operation is changed to denote the Empty
function, rather than the Empty_Vector constant.
* exp_aggr.adb (Expand_Container_Aggregate): Remove code for
handling the case where the Empty_Subp denotes a constant object,
which should never happen (and add an assertion that Empty_Subp
must denote a function).
* sem_ch13.adb (Valid_Empty): No longer allow the entity to be an
E_Constant, and require the (optional) parameter of an Empty
function to be of a signed integer type (rather than any integer
type).
2024-05-16 Justin Squirek <squirek@adacore.com>
* doc/gnat_rm/implementation_defined_attributes.rst: Add entry for
Super attribute.
* accessibility.adb (Accessibility_Level): Add handling for Super.
* exp_attr.adb (Expand_N_Attribute_Reference): Add entry for
Super.
* sem_attr.adb (Analyze_Attribute): Create a case to handle the
semantic checking and expansion for Super.
(Eval_Attribute): Add entry for Super.
* sem_attr.ads: Add entry for Super.
* sem_util.adb (Is_Aliased_View, Is_Variable): Add case to handle
references to 'Super.
* snames.ads-tmpl: Register Name_Super and Attribute_Super.
* gnat_rm.texi: Regenerate.
2024-05-16 Ronan Desplanques <desplanques@adacore.com>
* sem_util.ads (Check_Function_Writable_Actuals): Fix comment.
2024-05-16 Ronan Desplanques <desplanques@adacore.com>
* sem_res.adb (Resolve_Case_Expression): Add length check
insertion.
* exp_ch4.adb (Expand_N_Case_Expression): Add handling of nodes
known to raise Constraint_Error.
2024-05-16 Sebastian Poeplau <poeplau@adacore.com>
* adaint.c: New defines for STANDALONE mode.
2024-05-16 Viljar Indus <indus@adacore.com>
* sem_ch6.adb (Analyze_Subprogram_Body_Helper):
If the spec is not present for a subprogram body then
check if the body definiton was created for a protected
procedure.
2024-05-16 Piotr Trojanek <trojanek@adacore.com>
* exp_cg.adb (Generate_CG_Output): Remove code for ignored ghost
entities that applied to subprogram calls.
(Register_CG_Node): Skip ignored ghost entities, both calls
and tagged types, when they are registered.
2024-05-16 Ronan Desplanques <desplanques@adacore.com>
* checks.adb (Apply_Selected_Length_Checks): Fix reason code.
2024-05-16 Eric Botcazou <ebotcazou@adacore.com>
* libgnat/s-finpri.adb (Raise_From_Controlled_Operation): New
declaration of imported procedure moved from...
(Finalize_Master): ...there.
(Finalize): Call Raise_From_Controlled_Operation instead of
Reraise_Occurrence to propagate the exception, if any.
2024-05-16 Piotr Trojanek <trojanek@adacore.com>
* sem_ch4.adb (Analyze_If_Expression): Add guard for
if_expression without an ELSE part.
2024-05-16 Piotr Trojanek <trojanek@adacore.com>
* exp_ch13.adb (Expand_N_Free_Statement): After analysis, the
new temporary has the type of its Object_Definition and the new
occurrence of this temporary has this type as well; simplify.
* sem_util.adb
(Indirect_Temp_Value): Remove redundant call to Set_Etype;
simplify.
(Is_Access_Type_For_Indirect_Temp): Add missing body header.
2024-05-16 Piotr Trojanek <trojanek@adacore.com>
* sem_util.adb (Is_Known_On_Entry): Check whether condition and
dependent expressions of an if_expression are known on entry.
2024-05-16 Ronan Desplanques <desplanques@adacore.com>
* checks.ads: Fix comments.
* checks.adb: Likewise.
2024-05-16 Eric Botcazou <ebotcazou@adacore.com>
* libgnat/s-finpri.ads: Add use type clause for Storage_Offset.
(Header_Alignment): Turn into an expression function.
(Header_Size): Likewise.
* libgnat/s-finpri.adb: Remove use type clause for Storage_Offset.
(Header_Alignment): Delete.
(Header_Size): Likewise.
2024-05-16 Marc Poulhiès <poulhies@adacore.com>
* exp_ch7.adb (Unnest_Loop::Fixup_Inner_Scopes): detect a new
problematic pattern and fixup the scope accordingly.
2024-05-16 Piotr Trojanek <trojanek@adacore.com>
* gnat_cuda.adb (Remove_CUDA_Device_Entities): Fix typo.
2024-05-16 Eric Botcazou <ebotcazou@adacore.com>
* libgnat/s-finpri.ads (Header_Alignment): New function.
(Header_Size): Adjust description.
(Master_Node): Put Finalize_Address as first component.
(Collection_Node): Likewise.
* libgnat/s-finpri.adb (Header_Alignment): New function.
(Header_Size): Return the object size in storage units.
* libgnat/s-stposu.ads (Adjust_Controlled_Dereference): Replace
collection node with header in description.
* libgnat/s-stposu.adb (Adjust_Controlled_Dereference): Likewise.
(Allocate_Any_Controlled): Likewise. Pass the maximum of the
specified alignment and that of the header to the allocator.
(Deallocate_Any_Controlled): Likewise to the deallocator.
2024-05-16 Viljar Indus <indus@adacore.com>
* exp_aggr.adb (Two_Pass_Aggregate_Expansion):
Explicitly create new Defining_Iterators for both
of the loops.
2024-05-16 Eric Botcazou <ebotcazou@adacore.com>
* sem_ch6.adb (Check_Private_Overriding): Implement the second part
of RM 3.9.3(10) consistently in both cases.
2024-05-16 Piotr Trojanek <trojanek@adacore.com>
* erroutc.adb (Set_Msg_Insertion_Reserved_Word): Fix casing for
CUDA appearing in error message strings.
(Set_Msg_Str): Likewise for CUDA being a part of a Name_Id.
2024-05-16 Ronan Desplanques <desplanques@adacore.com>
* exp_ch4.adb (Expand_Composite_Equality): Call Error_Msg_N
instead of Error_Msg.
2024-05-16 Steve Baird <baird@adacore.com>
* exp_attr.adb (Build_And_Insert_Type_Attr_Subp): Further tweaking
of the point where a compiler-generated Put_Image or streaming
subprogram is to be inserted in the tree. If one such subprogram
calls another (as is often the case with, for example, Put_Image
procedures for composite type and for a component type thereof),
then we want to avoid use-before-definition problems that can
result from inserting the caller ahead of the callee.
2024-05-16 Eric Botcazou <ebotcazou@adacore.com>
* libgnat/s-finpri.ads (Lock_Type): New modular type.
(Collection_Node): Add Enclosing_Collection component.
(Finalization_Collection): Add Lock component.
* libgnat/s-finpri.adb: Add clauses for System.Atomic_Primitives.
(Attach_Object_To_Collection): Lock and unlock the collection.
Save a pointer to the enclosing collection in the node.
(Detach_Object_From_Collection): Lock and unlock the collection.
(Finalize): Likewise.
(Initialize): Initialize the lock.
(Lock_Collection): New procedure.
(Unlock_Collection): Likewise.
2024-05-16 Steve Baird <baird@adacore.com>
* sem_attr.adb (Eval_Attribute): Expand existing checks for
generic formal types for which Is_Generic_Type returns False. In
that case, mark the attribute reference as nonstatic.
2024-05-16 Steve Baird <baird@adacore.com>
* sem_util.adb (Copy_Node_With_Replacement): Add call to
Copy_Dimensions so that any dimension information associated with
the copied node is also associated with the resulting copy.
2024-05-16 Piotr Trojanek <trojanek@adacore.com>
* gen_il-gen-gen_nodes.adb (N_Procedure_Specification): Remove
Aspect_Specifications field.
2024-05-16 Piotr Trojanek <trojanek@adacore.com>
* sem_ch13.adb (Analyze_Aspect_Specification): Consistently
reuse existing constant where possible.
2024-05-16 Piotr Trojanek <trojanek@adacore.com>
* sem_ch13.adb (Analyze_Aspect_Specification): Consistently
reuse existing constant where possible.
2024-05-16 Piotr Trojanek <trojanek@adacore.com>
* aspects.ads (Aspect_Id): Fix ordering.
2024-05-16 Piotr Trojanek <trojanek@adacore.com>
* sem_prag.adb (Analyze_Pragma): Move case alternative to match
to alphabetic order.
2024-05-16 Piotr Trojanek <trojanek@adacore.com>
* gnat_cuda.adb (Remove_CUDA_Device_Entities): Fix casing
(this primarily fixes a style, because the capitalization will
not be preserved by the error-reporting machinery anyway).
* sem_ch13.adb (Analyze_User_Aspect_Aspect_Specification): Fix
casing in error message.
2024-05-16 Piotr Trojanek <trojanek@adacore.com>
* doc/gnat_rm/implementation_defined_pragmas.rst: Fix
documentation.
* sem_prag.adb: Fix comments.
* gnat_rm.texi: Regenerate.
2024-05-14 Piotr Trojanek <trojanek@adacore.com>
* aspects.ads (Aspect_Id, Boolean_Aspect): Change categorization
of Boolean-valued SPARK aspects.
* sem_ch13.adb (Analyze_Aspect_Specification): Adapt CASE
statements to new classification of Boolean-valued SPARK
aspects.
2024-05-14 Ronan Desplanques <desplanques@adacore.com>
* sem_ch13.adb (Validate_Unchecked_Conversions): Add node
parameters to Error_Msg calls.
2024-05-14 Marc Poulhiès <poulhies@adacore.com>
* sem_util.adb: Typo fix in comment.
* exp_aggr.adb: Likewise.
2024-05-14 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch7.adb (Finalization Management): Add a short description of
the implementation of finalization chains.
2024-05-14 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch4.adb (Expand_Allocator_Expression): Move the first call to
Build_Allocate_Deallocate_Proc up to before the accessibility check.
2024-05-14 Ronan Desplanques <desplanques@adacore.com>
* errout.adb (Validate_Specific_Warnings): Adapt to record
definition change.
* erroutc.adb (Set_Specific_Warning_On, Set_Specific_Warning_Off,
Warning_Specifically_Suppressed): Likewise.
* erroutc.ads: Change record definition.
2024-05-14 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch3.adb (Build_Default_Initialization): Do not generate the
protection for finalization collections.
(Build_Heap_Or_Pool_Allocator): Set the No_Initialization flag on
the declaration of the temporary.
* exp_ch4.adb (Build_Aggregate_In_Place): Do not build an allocation
procedure here.
(Expand_Allocator_Expression): Build an allocation procedure, if it
is required, only just before rewriting the allocator.
(Expand_N_Allocator): Do not build an allocation procedure if the
No_Initialization flag is set on the allocator, except for those
generated for special return objects. In other cases, build an
allocation procedure, if it is required, only before rewriting
the allocator.
* exp_ch7.ads (Make_Address_For_Finalize): New function declaration.
* exp_ch7.adb (Finalization Management): Update description for
dynamically allocated objects.
(Make_Address_For_Finalize): Remove declaration.
(Find_Last_Init): Change to function and move to...
(Process_Object_Declaration): Adjust to above change.
* exp_util.ads (Build_Allocate_Deallocate_Proc): Add Mark parameter
with Empty default and document it.
(Find_Last_Init): New function declaration.
* exp_util.adb (Build_Allocate_Deallocate_Proc): Add Mark parameter
with Empty default and pass it in recursive call. Deal with type
conversions created for interface types. Adjust call sequence to
Allocate_Any_Controlled by changing Collection to In/Out parameter
and removing Finalize_Address parameter. For a controlled object,
generate a conditional call to Attach_Object_To_Collection for an
allocation and to Detach_Object_From_Collection for a deallocation.
(Find_Last_Init): ...here. Compute the initialization type for an
allocator whose designating type is class wide specifically and also
handle concurrent types.
* rtsfind.ads (RE_Id): Add RE_Attach_Object_To_Collection and
RE_Detach_Object_From_Collection.
(RE_Unit_Table): Add entries for RE_Attach_Object_To_Collection and
RE_Detach_Object_From_Collection.
* libgnat/s-finpri.ads (Finalization_Started): Delete.
(Attach_Node_To_Collection): Likewise.
(Detach_Node_From_Collection): Move to...
(Attach_Object_To_Collection): New procedure declaration.
(Detach_Object_From_Collection): Likewise.
(Finalization_Collection): Remove Atomic for Finalization_Started.
Add pragma Inline for Initialize.
* libgnat/s-finpri.adb: Add clause for Ada.Unchecked_Conversion.
(To_Collection_Node_Ptr): New instance of Ada.Unchecked_Conversion.
(Detach_Node_From_Collection): ...here.
(Attach_Object_To_Collection): New procedure.
(Detach_Object_From_Collection): Likewise.
(Finalization_Started): Delete.
(Finalize): Replace allocation with attachment in comments.
* libgnat/s-stposu.ads (Allocate_Any_Controlled): Rename parameter
Context_Subpool into Named_Subpool, parameter Context_Collection
into Collection and change it to In/Out, and remove Fin_Address.
* libgnat/s-stposu.adb: Remove clause for Ada.Unchecked_Conversion
and Finalization_Primitives.
(To_Collection_Node_Ptr): Delete.
(Allocate_Any_Controlled): Rename parameter Context_Subpool into
Named_Subpool, parameter Context_Collection into Collection and
change it to In/Out, and remove Fin_Address. Do not lock/unlock
and do not attach the object, instead only displace its address.
(Deallocate_Any_Controlled): Do not lock/unlock and do not detach
the object.
(Header_Size_With_Padding): Use qualified name for Header_Size.
2024-05-14 Steve Baird <baird@adacore.com>
* exp_attr.adb (Build_And_Insert_Type_Attr_Subp): If a subprogram
associated with a (library-level) type declared in another unit is
to be inserted somewhere in a list, then insert it at the head of
the list.
* sem_ch5.adb (Analyze_Assignment): Normally a limited-type
assignment is illegal. Relax this rule if Comes_From_Source is
False and the type is not immutably limited.
2024-05-14 Ronan Desplanques <desplanques@adacore.com>
* errout.ads (Error_Msg): Add node parameter.
* errout.adb (Error_Msg): Add parameter and pass it to
the underlying call.
* sem_prag.adb (Validate_Compile_Time_Warning_Or_Error): Pass
pragma node when emitting errors.
2024-05-14 Ronan Desplanques <desplanques@adacore.com>
* styleg.ads (Check_Xtra_Parens_Precedence): Moved ...
* style.ads (Check_Xtra_Parens_Precedence): ... here. Also
replace corresponding renaming.
* styleg.adb (Check_Xtra_Parens_Precedence): Moved ...
* style.adb (Check_Xtra_Parens_Precedence): here. Also use
Errout.Error_Msg and pass it a node parameter.
2024-05-14 Eric Botcazou <ebotcazou@adacore.com>
* exp_aggr.ads (Convert_Aggr_In_Allocator): Rename Alloc into N,
replace Decl with Temp and adjust description.
(Convert_Aggr_In_Object_Decl): Alphabetize.
(Is_Delayed_Aggregate): Likewise.
* exp_aggr.adb (Convert_Aggr_In_Allocator): Rename Alloc into N
and replace Decl with Temp. Allocate a list only when neeeded.
(Convert_Array_Aggr_In_Allocator): Replace N with Decl and insert
new code before it.
* exp_ch4.adb (Build_Aggregate_In_Place): New procedure nested in
Expand_Allocator_Expression.
(Expand_Allocator_Expression): Call it to build aggregates in place.
Remove second parameter in calls to Build_Allocate_Deallocate_Proc.
(Expand_N_Allocator): Likewise.
* exp_ch13.adb (Expand_N_Free_Statement): Likewise.
* exp_util.ads (Build_Allocate_Deallocate_Proc): Remove Is_Allocate
parameter.
* exp_util.adb (Build_Allocate_Deallocate_Proc): Remove Is_Allocate
parameter and replace it with local variable of same name. Delete
useless pattern matching.
2024-05-14 Ronan Desplanques <desplanques@adacore.com>
* usage.adb (Usage): Fix enabled-by-default indicators.
2024-05-14 Philippe Gil <gil@adacore.com>
* libgnat/s-win32.ads (LocalFileTimeToFileTime): Swap parameters.
2024-05-14 Ronan Desplanques <desplanques@adacore.com>
* restrict.adb (Violation_Of_No_Dependence): Tweak error
reporting calls.
2024-05-14 Ronan Desplanques <desplanques@adacore.com>
* sem_prag.adb (Analyze_Pragma): Adapt call to new signature.
* erroutc.ads (Set_Specific_Warning_Off): change signature
and update documentation.
(Validate_Specific_Warnings): Move ...
* errout.adb: ... here and change signature. Also move body
of Validate_Specific_Warnings from erroutc.adb.
(Finalize): Adapt call.
* errout.ads (Set_Specific_Warning_Off): Adapt signature of
renaming.
* erroutc.adb (Set_Specific_Warning_Off): Adapt signature and
body.
(Validate_Specific_Warnings): Move to the body of Errout.
(Warning_Specifically_Suppressed): Adapt body.
2024-05-14 Eric Botcazou <ebotcazou@adacore.com>
* exp_aggr.adb (Build_Array_Aggr_Code): Pass N in the call to
Build_Initialization_Call.
(Build_Record_Aggr_Code): Likewise.
(Convert_Aggr_In_Object_Decl): Likewise.
(Initialize_Discriminants): Likewise.
* exp_ch3.ads (Build_Initialization_Call): Replace Loc witn N.
* exp_ch3.adb (Build_Array_Init_Proc): Pass N in the call to
Build_Initialization_Call.
(Build_Default_Initialization): Likewise.
(Expand_N_Object_Declaration): Likewise.
(Build_Initialization_Call): Replace Loc witn N parameter and add
Loc local variable. Build a default subtype for an allocator of
a discriminated type with defaulted discriminants.
(Build_Record_Init_Proc): Pass the declaration of components in the
call to Build_Initialization_Call.
* exp_ch6.adb (Make_CPP_Constructor_Call_In_Allocator): Pass the
allocator in the call to Build_Initialization_Call.
2024-05-14 Ronan Desplanques <desplanques@adacore.com>
* sem_warn.adb (Warn_On_Overlapping_Actuals): Fix typo.
2024-05-14 Gary Dismukes <dismukes@adacore.com>
* exp_util.adb (Find_Hook_Context): Exclude N_*Aggregate Nkinds
of Parent (Par) from the early return in the second loop of the
In_Cond_Expr case, to prevent returning an aggregate from this
function rather than the enclosing declaration or statement.
2024-05-14 Steve Baird <baird@adacore.com>
* exp_attr.adb: Replace 6 "not Present" tests with equivalent calls to "No".
2024-05-14 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch3.adb (Expand_N_Object_Declaration): Examine the Expression
field after the call to Default_Initialize_Object in order to set
Is_Known_Null, as well as Is_Known_Non_Null, on an access object.
2024-05-14 Steve Baird <baird@adacore.com>
* exp_attr.adb: Change name of package Cached_Streaming_Ops to
reflect the fact that it is now also used for Put_Image
procedures. Similarly change other "Streaming_Op" names therein.
Add Validate_Cached_Candidate procedure to detect case where a
subprogram found in the cache cannot be reused. Add new generic
procedure Build_And_Insert_Type_Attr_Subp; the "Build" part is
handled by just calling a formal procedure; the bulk of this
(generic) procedure's code has to with deciding where in the tree
to insert the newly-constructed subprogram. Replace each later
"Build" call (and the following Insert_Action or
Compile_Stream_Body_In_Scope call) with a declare block that
instantiates and then calls this generic procedure. Delete the
now-unused procedure Compile_Stream_Body_In_Scope. A constructed
subprogram is entered in the appropriate cache if the
corresponding type is untagged; this replaces more complex tests.
A new function Interunit_Ref_OK is added to determine whether an
attribute reference occuring in one unit can safely refer to a
cached subprogram declared in another unit.
* exp_ch3.adb (Build_Predefined_Primitive_Bodies): A formal
parameter was deleted, so delete the corresponding actual in a
call.
* exp_put_image.adb (Build_Array_Put_Image_Procedure): Because the
procedure being built may be referenced more than once, the
generated procedure takes its source position info from the type
declaration instead of the (first) attribute reference.
(Build_Record_Put_Image_Procedure): Likewise.
* exp_put_image.ads (Build_Array_Put_Image_Procedure): Eliminate
now-unused Nod parameter.
(Build_Record_Put_Image_Procedure): Eliminate now-unused Loc parameter.
* sem_ch3.adb (Constrain_Discriminated_Type): For declaring a
subtype with a discriminant constraint, ignore privacy if
Comes_From_Source is false (as is already done if Is_Instance is
true).
* sem_res.adb (Resolve): When passed two type entities that have
the same underlying base type, Sem_Type.Covers may return False in
some cases because of privacy. [This can happen even if
Is_Private_Type returns False both for Etype (N) and for Typ;
Covers calls Base_Type, which can take a non-private argument and
yield a private result.] If Comes_From_Source (N) is False
(e.g., for a compiler-generated Put_Image or streaming subprogram), then
avoid that scenario by not calling Covers. Covers already has tests for
doing this sort of thing (see the calls therein to Full_View_Covers),
but the Comes_From_Source test is too coarse to apply there. So instead
we handle the problem here at the call site.
(Original_Implementation_Base_Type): A new function. Same as
Implementation_Base_Type except if the Original_Node attribute of
a non-derived type declaration indicates that it once was a derived
type declaration. Needed for looking through privacy.
(Valid Conversion): Ignore privacy when converting between different views
of the same type if Comes_From_Source is False for the conversion.
(Valid_Tagged_Conversion): An ancestor-to-descendant conversion is not an
illegal downward conversion if there is no type extension involved
(because the derivation was from an untagged view of the parent type).
2024-05-14 Steve Baird <baird@adacore.com>
* sem_ch5.adb (Analyze_Case_Statement): Emit a message and return
early in the case where general case statements are allowed but
the selector expression is of a private type. This is done to
avoid a bugbox.
2024-05-14 Justin Squirek <squirek@adacore.com>
* sem_util.adb (Set_Referenced_Modified): Use Original_Node to
avoid recursive calls on expanded / internal objects such that
source nodes get appropriately marked as referenced.
2024-05-14 Ronan Desplanques <desplanques@adacore.com>
* sem_warn.adb (Warn_On_Overlapping_Actuals): Stop ignoring
warning suppression settings.
2024-05-14 Eric Botcazou <ebotcazou@adacore.com>
* exp_util.adb (Build_Allocate_Deallocate_Proc): Pass the alignment
parameter in the inner call for a secondary stack allocation too.
2024-05-14 Javier Miranda <miranda@adacore.com>
* sem_ch10.adb (Install_Inherited_Policy_Pragmas): New subprogram.
(Remove_Inherited_Policy_Pragmas): New subprogram.
(Analyze_Compilation_Unit): Call the new subprograms to
install and remove inherited assertion policy pragmas.
2024-05-14 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch4.adb (Expand_N_If_Expression): Set No_Initialization on the
declaration of the temporary in the by-reference case.
* exp_util.adb (Initialized_By_Access): Delete.
(Is_Allocated): Likewise.
(Initialized_By_Reference): New predicate.
(Is_Finalizable_Transient): If the transient object is of an access
type, do not return true unless it is initialized by a reference.
2024-05-14 Steve Baird <baird@adacore.com>
* exp_attr.adb: Move computation of Accum_Typ entirely into the
function Build_Stat.
2024-05-14 Steve Baird <baird@adacore.com>
* sem_ch12.ads: Declare new Instance_Context package, which
declares a private type Context with operations Save_And_Reset and
Restore.
* sem_ch12.adb: Provide body for new Instance_Context package.
* rtsfind.adb (Load_RTU): Wrap an Instance_Context Save/Restore
call pair around the call to Semantics.
* table.ads: Add initial value for Last_Val (because
Save_And_Reset expects Last_Val to be initialized).
2024-05-14 Eric Botcazou <ebotcazou@adacore.com>
* exp_aggr.adb (Build_Record_Aggr_Code): Replace reference to
Build_Task_Allocate_Block_With_Init_Stmts in comment with reference
to Build_Task_Allocate_Block.
(Convert_Aggr_In_Allocator): Likewise for the call in the code.
* exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Likewise.
* exp_ch3.ads: Alphabetize clauses.
(Build_Default_Initialization): New function declaration.
(Build_Default_Simple_Initialization): Likewise.
(Build_Initialization_Call): Add Target_Ref parameter with default.
* exp_ch3.adb (Build_Default_Initialization): New function extracted
from...
(Build_Default_Simple_Initialization): Likewise.
(Build_Initialization_Call): Add Target_Ref parameter with default.
(Expand_N_Object_Declaration): ...here.
(Default_Initialize_Object): Call Build_Default_Initialization and
Build_Default_Simple_Initialization.
* exp_ch4.adb (Expand_Allocator_Expression): Minor comment tweaks.
(Expand_N_Allocator): Call Build_Default_Initialization and
Build_Default_Simple_Initialization to implement the default
initialization of the allocated object.
* exp_ch9.ads (Build_Task_Allocate_Block): Delete.
(Build_Task_Allocate_Block_With_Init_Stmts): Rename into...
(Build_Task_Allocate_Block): ...this.
* exp_ch9.adb: Remove clauses for Exp_Tss.
(Build_Task_Allocate_Block): Delete.
(Build_Task_Allocate_Block_With_Init_Stmts): Rename into...
(Build_Task_Allocate_Block): ...this.
* exp_util.adb (Build_Allocate_Deallocate_Proc): Remove unnecessary
initialization expression, adjust commentary and replace early exit
with assertion.
* sem_ch4.adb (Analyze_Allocator): In the null-exclusion case, call
Apply_Compile_Time_Constraint_Error to insert the raise.
2024-05-14 Ronan Desplanques <desplanques@adacore.com>
* styleg.ads (Check_Boolean_Operator): Moved ...
* style.ads (Check_Boolean_Operator): ... here.
* styleg.adb (Check_Boolean_Operator): Moved ...
* style.adb (Check_Boolean_Operator): ... here. Also add node
parameter to call to Errout.Error_Msg.
2024-05-14 Eric Botcazou <ebotcazou@adacore.com>
* sprint.adb (Sprint_Node_Actual) <N_Raise_Statement>: Be prepared
for an empty Name.
<N_Raise_When_Statement>: Likewise.
2024-05-14 Yannick Moy <moy@adacore.com>
* contracts.adb: Fix references to SPARK RM rules.
* freeze.adb: Same.
* ghost.adb: Fix references to SPARK RM rules.
(Check_Ghost_Context): Update checking of references to
ghost entities in assertion expressions.
* sem_ch6.adb: Fix references to SPARK RM rules.
* sem_prag.adb: Same.
2024-05-14 Yannick Moy <moy@adacore.com>
* ghost.adb (Mark_And_Set_Ghost_Instantiation): Fix the current
Ghost policy for the instantiation.
2024-05-14 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch3.adb (Default_Initialize_Object): Return immediately when
either Has_Init_Expression or No_Initialization is set on the node.
Tidy up the rest of the code accordingly.
(Simple_Initialization_OK): Do not test Has_Init_Expression here.
2024-05-13 Eric Botcazou <ebotcazou@adacore.com>
* accessibility.adb: Remove clauses for Exp_Ch3.
* exp_ch3.ads (Init_Proc_Level_Formal): Move declaration to...
* exp_ch3.adb (Init_Proc_Level_Formal): Move body to...
* exp_util.ads (Init_Proc_Level_Formal): ...here.
(Inside_Init_Proc): Alphabetize.
* exp_util.adb (Init_Proc_Level_Formal): ...here.
2024-05-13 Piotr Trojanek <trojanek@adacore.com>
* sem_util.adb (Is_Potentially_Unevaluated): Remove code for
recovering the original structure of expressions with AND THEN.
2024-05-13 Piotr Trojanek <trojanek@adacore.com>
* sem_attr.adb (Attribute_22): Remove Put_Image and Object_Size.
* sem_attr.ads (Attribute_Imp_Def): Restore Object_Size.
2024-05-13 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch7.adb: Adjust the description of finalization management.
(Build_Finalizer): Rename scope master into master throughout.
* rtsfind.ads (RE_Id): Replace RE_Finalization_Scope_Master with
RE_Finalization_Master.
(RE_Unit_Table): Replace entry for RE_Finalization_Scope_Master with
entry for RE_Finalization_Master.
* libgnat/s-finpri.ads (Finalization_Scope_Master): Rename into...
(Finalization_Master): ...this.
(Attach_Object_To_Master): Adjust to above renaming.
(Chain_Node_To_Master): Likewise.
(Finalize_Master): Likewise.
* libgnat/s-finpri.adb (Attach_Object_To_Master): Likewise.
(Chain_Node_To_Master): Likewise.
(Finalize_Master): Likewise.
2024-05-13 Eric Botcazou <ebotcazou@adacore.com>
* libgnat/s-imaged.ads (System.Image_D): Add Uns formal parameter.
* libgnat/s-imaged.adb: Add with clauses for System.Image_I,
System.Value_I_Spec and System.Value_U_Spec.
(Uns_Spec): New instance of System.Value_U_Spec.
(Int_Spec): New instance of System.Value_I_Spec.
(Image_I): New instance of System.Image_I.
(Set_Image_Integer): New renaming.
(Set_Image_Decimal): Replace 'Image with call to Set_Image_Integer.
* libgnat/s-imde32.ads (Uns32): New subtype.
(Impl): Pass Uns32 as second actual paramter to Image_D.
* libgnat/s-imde64.ads (Uns64): New subtype.
(Impl): Pass Uns64 as second actual paramter to Image_D.
* libgnat/s-imde128.ads (Uns128): New subtype.
(Impl): Pass Uns128 as second actual paramter to Image_D.
* libgnat/s-imagef.adb (Set_Image_Fixed): Document bounds for the
A, D and AF local constants.
2024-05-13 Piotr Trojanek <trojanek@adacore.com>
* sem_attr.adb (Attribute_22): Add Put_Image and Object_Size.
* sem_attr.ads (Attribute_Imp_Def): Remove Object_Size.
2024-05-13 Piotr Trojanek <trojanek@adacore.com>
* aspects.adb (Copy_Aspects): Style fix.
* contracts.adb (Analyze_Contracts): Style fix.
(Save_Global_References_In_Contract): Remove extra guards.
* par_sco.adb (Traverse_Aspects): Move guard to the caller and
make it consistent with Save_Global_References_In_Contract.
* sem_ch12.adb (Has_Contracts): Remove extra guards.
* sem_ch3.adb (Delayed_Aspect_Present, Get_Partial_View_Aspect,
Check_Duplicate_Aspects): Likewise.
* sem_disp.adb (Check_Dispatching_Operation): Likewise.
2024-05-13 Bob Duff <duff@adacore.com>
* errout.adb (Output_Messages): Protect against the total going
negative.
2024-05-13 Piotr Trojanek <trojanek@adacore.com>
* contracts.adb (Append_Enabled_Item): Remove use of Split_PPC;
simplify.
* gen_il-fields.ads (Opt_Field_Enum): Remove flag definition.
* gen_il-gen-gen_nodes.adb (N_Aspect_Specification, N_Pragma):
Remove Split_PPC flags.
* gen_il-internals.adb (Image): Remove use of Split_PPC.
* par_sco.adb (Traverse_Aspects): Likewise.
* sem_ch13.adb (Make_Aitem_Pragma): Likewise.
* sem_ch6.adb (List_Inherited_Pre_Post_Aspects): Likewise.
* sem_prag.adb (Analyze_Pre_Post_Condition, Analyze_Pragma,
Find_Related_Declaration_Or_Body): Likewise.
* sem_util.adb (Applied_On_Conjunct): Likewise.
* sinfo.ads: Remove flag documentation.
* treepr.adb (Image): Remove use of Split_PPC.
2024-05-13 Piotr Trojanek <trojanek@adacore.com>
* exp_ch6.adb (Append_Message): Build the location string from
scratch and not rely on the one produced while splitting the
aspect into pragmas.
* exp_prag.adb (Expand_Pragma_Check): Split pre/post checks in
expansion.
* sem_ch13.adb (Analyze_Aspect_Specification): Don't split
pre/post expressions into conjuncts; don't add message with
location to the corresponding pragma.
* sem_prag.adb (Build_Pragma_Check_Equivalent): Inherited
pragmas no longer have messages that would need to be updated.
* sinput.adb (Build_Location_String): Adjust to keep previous
messages while using with inherited pragmas.
2024-05-13 Piotr Trojanek <trojanek@adacore.com>
* contracts.adb (Inherit_Subprogram_Contract): Fix style.
* sem_ch5.adb (Analyze_Iterator_Specification): Likewise.
2024-05-13 Piotr Trojanek <trojanek@adacore.com>
* sem_util.adb (Has_No_Output): Iteration with
First_Formal/Next_Formal involves Entity_Ids.
2024-05-13 Piotr Trojanek <trojanek@adacore.com>
* sem_prag.adb (Analyze_Pragma): When processing pragma
Lock_Free, check if restriction No_Implementation_Pragmas is
enabled.
2024-05-13 Piotr Trojanek <trojanek@adacore.com>
* gen_il-fields.ads (Opt_Field_Enum):
Remove Is_Expanded_Contract from the list of flags.
* gen_il-gen-gen_nodes.adb (N_Contract): Remove
Is_Expanded_Contract from the list of N_Contract fields.
* sinfo.ads (Is_Expanded_Contract): Remove comments for the flag
and its single occurrence in N_Contract.
2024-05-13 Piotr Trojanek <trojanek@adacore.com>
* exp_ch9.adb (Build_Protected_Subprogram_Body,
Build_Protected_Subprogram_Call_Cleanup): Reuse refactored
routine.
* sem_util.adb
(Has_Enabled_Aspect): Refactored repeated code.
(Is_Static_Function): Reuse refactored routine.
* sem_util.ads (Has_Enabled_Aspect):
New query routine refactored from repeated code.
2024-05-13 Piotr Trojanek <trojanek@adacore.com>
* exp_ch9.adb (Build_Protected_Subprogram_Call_Cleanup): If
aspect Exclusive_Functions is present then the cleanup of a
protected function now services queued entries, just like the
cleanup of a protected procedure.
2024-05-13 Bob Duff <duff@adacore.com>
* sem_util.ads (Append_Entity_Name): Fix comment to reflect new
semantics. The comment said, "The qualification stops at an
enclosing scope has no source name (block or loop)." There seems
to be no reason for stopping; instead, we should SKIP things with
no source name. And the "loop" part was wrong.
* sem_util.adb (Append_Entity_Name): Do not stop the recursion;
skip to next-outer scope instead. Misc cleanup/simplification.
2024-05-13 Eric Botcazou <ebotcazou@adacore.com>
* libgnat/s-finpri.adb (Finalize): Replace "master" by "collection"
in comments and add a comment about the form of the loop.
* libgnat/s-stposu.adb (Allocate_Any_Controlled): Tweak comment.
2024-05-13 Eric Botcazou <ebotcazou@adacore.com>
* Makefile.rtl (GNATRTL_NONTASKING_OBJS): Remove s-finmas$(objext).
* einfo.ads (Anonymous_Masters): Rename into Anonymous_Collections.
(Finalization_Master): Rename into Finalization_Collection.
* gen_il-fields.ads (Opt_Field_Enum): Replace Anonymous_Masters
with Anonymous_Collections; and Finalization_Master with
Finalization_Collection.
* gen_il-gen-gen_entities.adb (Access_Kind): Likewise.
(E_Function): Likewise.
(E_Procedure): Likewise.
(E_Package): Likewise.
(E_Subprogram_Body): Likewise.
* exp_ch3.adb (Build_Heap_Or_Pool_Allocator): Adjust to renamings.
(Freeze_Type): Likewise.
(Stream_Operation_OK): Remove obsolete test.
* exp_ch4.adb (Expand_Allocator_Expression): Adjust to renamings.
(Expand_N_Allocator): Likewise.
* exp_ch6.ads (BIP_Formal_Kind): Replace BIP_Finalization_Master
with BIP_Collection.
(Needs_BIP_Finalization_Master): Rename into...
(Needs_BIP_Collection): ...this.
* exp_ch6.adb (BIP_Finalization_Master_Suffix): Delete.
(BIP_Collection_Suffix): New constant string.
(Add_Finalization_Master_Actual_To_Build_In_Place_Call): Rename to
(Add_Collection_Actual_To_Build_In_Place_Call): ...this and adjust.
(BIP_Formal_Suffix): Replace BIP_Finalization_Master alternative
with BIP_Collection alternative.
(BIP_Suffix_Kind): Replace test on BIP_Finalization_Master_Suffix
with test on BIP_Collection_Suffix.
(Is_Build_In_Place_Entity): Likewise.
(Make_Build_In_Place_Call_In_Allocator): Call Needs_BIP_Collection
and Add_Collection_Actual_To_Build_In_Place_Call.
(Make_Build_In_Place_Call_In_Anonymous_Context): Likewise.
(Make_Build_In_Place_Call_In_Assignment): Likewise.
(Make_Build_In_Place_Call_In_Object_Declaration): Likewise.
(Needs_BIP_Finalization_Master): Rename into...
(Needs_BIP_Collection): ...this.
(Needs_BIP_Alloc_Form): Call Needs_BIP_Collection.
* exp_ch7.ads (Build_Anonymous_Master): Rename into...
(Build_Anonymous_Collection): ...this.
(Build_Finalization_Master): Rename into...
(Build_Finalization_Collection): ...this.
* exp_ch7.adb (Allows_Finalization_Master): Rename into...
(Allows_Finalization_Collection): ...this.
(Build_BIP_Cleanup_Stmts): Adjust to renamings.
(Build_Anonymous_Master): Rename into...
(Build_Anonymous_Collection): ...this. Adjust to renamings.
(Build_Finalization_Master): Rename into...
(Build_Finalization_Collection): ...this. Adjust to renamings.
(Build_Finalizer): Adjust comment to renamings.
* exp_ch13.adb (Expand_N_Free_Statement): Adjust to renamings.
* exp_util.adb (Build_Allocate_Deallocate_Proc): Likewise.
(Requires_Cleanup_Actions): Adjust comment to renamings.
* freeze.adb (Freeze_All): Likewise.
* rtsfind.ads (RTU_Id): Remove System_Finalization_Masters.
(RE_Id): Remove RE_Finalization_Master & RE_Finalization_Master_Ptr
add RE_Finalization_Collection & RE_Finalization_Collection_Ptr.
Adjust RE_Add_Offset_To_Address and RE_Finalization_Scope_Master.
(RE_Unit_Table): Remove entries for RE_Finalization_Master &
RE_Finalization_Master_Ptr, add ones for RE_Finalization_Collection
& RE_Finalization_Collection_Ptr. Also adjust those of
RE_Add_Offset_To_Address and RE_Finalization_Scope_Master.
* sem_ch3.adb (Access_Type_Declaration): Adjust to renamings.
* sem_ch6.adb (Create_Extra_Formals): Likewise.
* sem_util.adb (Designated_Subtype_Mark): Likewise.
* libgnat/s-finpri.ads: Add clauses for Ada.Finalization and
System.Storage_Elements.
(Finalization_Collection): New limited controlled type.
(Finalization_Collection_Ptr): Likewise.
(Initialize): New overriding procedure.
(Finalize): Likewise.
(Finalization_Started): Likewise.
(Collection_Node): New type.
(Collection_Node_Ptr): Likewise.
(Attach_Node_To_Collection): New procedure.
(Detach_Node_From_Collection): Likewise.
(Header_Size): New function.
(Add_Offset_To_Address): Likewise.
* libgnat/s-finpri.adb (Add_Offset_To_Address): New function.
(Attach_Node_To_Collection): New procedure.
(Detach_Node_From_Collection): Likewise.
(Finalization_Started): Likewise.
(Finalize): New overriding procedure.
(Header_Size): New function.
(Initialize): New overriding procedure.
* libgnat/s-spsufi.ads (Finalize_And_Deallocate): Adjust comment.
* libgnat/s-spsufi.adb: Remove clause for Finalization_Masters and
add clause for Finalization_Primitives.
(Finalize_And_Deallocate): Finalize the Collection component.
* libgnat/s-stposu.ads: Remove clause for Finalization_Masters and
add clause for Finalization_Primitives.
(Root_Subpool): Replace Master component with Collection.
(Allocate_Any_Controlled): Replace Context_Master parameter with
Context_Collection parameter.
* libgnat/s-stposu.adb: Remove clauses for Finalization_Masters and
add clauses for Finalization_Primitives.
(Address_To_FM_Node_Ptr): Delete.
(To_Collection_Node_Ptr): New instance of Ada.Unchecked_Conversion.
(Adjust_Controlled_Dereference): Adjust comment to renamings.
(Allocate_Any_Controlled): Replace Context_Master parameter with
Context_Collection parameter. Adjust to renamings.
(Deallocate_Any_Controlled): Adjust to renamings.
(Print_Subpool): Likewise.
* libgnat/s-finmas.ads: Delete.
* libgnat/s-finmas.adb: Likewise.
2024-05-13 Ashley Gay <gay@adacore.com>
* Makefile.rtl: remove i-vxinco.* from the build
* doc/gnat_rm/the_gnat_library.rst: Remove i-vxinco.ads from
the units documentation.
* impunit.adb: Remove i-vxinco from the list of available units
in GNATstudio.
* libgnarl/i-vxinco.adb: Remove.
* libgnarl/i-vxinco.ads: Ditto.
* libgnarl/s-interr__vxworks.adb: enrich comment
* libgnarl/s-vxwext__kernel.ads: fix comment
* libgnat/i-vxwork.ads: Remove deprecated interrupt connections
API, as well as an example.
* libgnat/i-vxwork__x86.ads: Ditto and add the paragma
Obscolescent to Attach_Handler
* gnat_rm.texi: Regenerate.
2024-05-13 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch3.adb (Build_Heap_Or_Pool_Allocator): Use the BIPstoragepool
formal parameter to retrieve the pool in the presence of a master.
* exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Always pass
a pool reference along with the master reference.
(Make_Build_In_Place_Call_In_Object_Declaration): Likewise.
* exp_ch7.adb (Build_BIP_Cleanup_Stmts): Use the BIPstoragepool
formal parameter to retrieve the pool in the presence of a master.
(Create_Anonymous_Master): Do not call Set_Base_Pool.
(Build_Finalization_Master): Likewise.
* rtsfind.ads (RE_Id): Remove RE_Base_Pool and RE_Set_Base_Pool.
(RE_Unit_Table): Remove associated entries.
* libgnat/s-finmas.ads: Remove clause for System.Storage_Pools.
(Any_Storage_Pool_Ptr): Delete.
(Finalization_Master): Remove Base_Pool component.
(Base_Pool): Delete.
(Set_Base_Pool): Likewise.
* libgnat/s-finmas.adb (Base_Pool): Likewise.
(Set_Base_Pool): Likewise.
(Print_Master): Do not print Base_Pool.
2024-05-13 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch6.adb (Add_Unconstrained_Actuals_To_Build_In_Place_Call):
Rename Pool_Actual into Pool_Exp and use Empty as default value.
(Add_Finalization_Master_Actual_To_Build_In_Place_Call): Change the
names of the first two parameters and use a simpler code structure.
(Make_Build_In_Place_Call_In_Allocator): Rename the local variable
for the pool actual and set it to Empty if it is not used.
(Make_Build_In_Place_Call_In_Object_Declaration): Rename the local
variable for the master actual.
2024-05-13 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch3.adb (Expand_N_Object_Declaration): In the case of a
return object of a BIP function that needs finalization, save
the assignment statement made to initialize it, if any.
* exp_ch6.ads (BIP_Formal_Kind): Adjust description.
* exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Make a
couple of adjustments to the commentary.
(Needs_BIP_Alloc_Form): Also return true if the function needs
a BIP_Finalization_Master parameter.
* exp_ch7.adb (Build_BIP_Cleanup_Stmts): Remove now always true
test on Needs_BIP_Alloc_Form.
(Attach_Object_To_Master_Node): Remove duplication in comment.
2024-05-13 Piotr Trojanek <trojanek@adacore.com>
* sem_util.adb (Get_Index_Bounds): Guard against missing Entity,
which happens on illegal constrained type declaration.
2024-05-13 Eric Botcazou <ebotcazou@adacore.com>
* sem_attr.adb (Eval_Attribute): Treat Alignment like Component_Size
for array types.
2024-05-13 Steve Baird <baird@adacore.com>
* sem_case.adb: Replace all tests of Core_Extensions_Allowed with
corresponding tests of All_Extensions_Allowed.
* sem_ch5.adb: Likewise.
* doc/gnat_rm/gnat_language_extensions.rst: update documentation.
* gnat_rm.texi: Regenerate.
2024-05-13 Eric Botcazou <ebotcazou@adacore.com>
* sem_ch13.adb (New_Put_Image_Subprogram): In the nondeferred case
coming from an aspect and for a type with delaying freezing, also
freeze the subprogram immediately.
2024-05-13 Piotr Trojanek <trojanek@adacore.com>
* libgnat/a-direct.adb (Start_Search_Internal): Combine subtype
and object declaration.
* libgnat/g-dirope.adb (Read): Replace convoluted unchecked
conversion with an overlay.
2024-05-13 Piotr Trojanek <trojanek@adacore.com>
* libgnat/g-dirope.adb (Read): Use null-excluding,
access-to-constant type; replace element-by-element copy with
array assignments.
2024-05-13 Gary Dismukes <dismukes@adacore.com>
* exp_aggr.adb (Expand_Container_Aggregate): Move determination of
whether the aggregate is an indexed aggregate earlier in the
procedure. Test Is_Indexed_Aggregate as a criterion for generating
a call to the container type's New_Indexed function, add proper
computation of bounds to pass in to the function, and remove later
code for generating such a call. Add and improve comments.
(Aggregate_Size): Remove special treatment of case where there is
exactly one component association, and instead loop over all
component associations to determine whether any of them have a
nonstatic length. If there is at least one such nonstatic
association, return -1.
(Build_Siz_Exp): Accumulate a sum of the sizes of each of the
component associations in Siz_Exp (which will only be used if
there any associations that are of Nkind
N_Iterated_Component_Association with a nonstatic range).
(Expand_Range_Component): Fix typos in the procedure's spec
comment and block comment.
2024-05-07 Piotr Trojanek <trojanek@adacore.com>
* sem_util.adb (Number_Of_Elements_In_Array): Fix counting of
elements in null arrays; remove redundant parenthesis; avoid
run-time conversion of 1 to universal integer.
2024-05-07 Piotr Trojanek <trojanek@adacore.com>
* lib.ads, lib.adb (Primary_Stack_Count, Sec_Stack_Count,
Increment_Primary_Stack_Count, Increment_Sec_Stack_Count,
Unit_Record): Stack counts are never negative.
* ali.ads (Unit_Record): Likewise.
* bindgen.adb (Num_Primary_Stacks, Num_Sec_Stacks): Likewise.
* exp_ch3.adb (Count_Default_Sized_Task_Stacks): Likewise.
* sem_util.ads, sem_util.adb (Number_Of_Elements_In_Array):
Likewise.
2024-05-07 Piotr Trojanek <trojanek@adacore.com>
* exp_ch3.adb (Count_Default_Sized_Task_Stacks): Do not look for
tasks inside record discriminants; remove avoid repeated call to
Has_Task that happened for record components.
(Expand_N_Object_Declaration): Use high-level routine to detect
array types and subtypes; remove unused initial values.
2024-05-07 Piotr Trojanek <trojanek@adacore.com>
* exp_aggr.ads (Static_Array_Aggregate): Fix typo in comment.
2024-05-07 Piotr Trojanek <trojanek@adacore.com>
* inline.adb (Has_Single_Return): Remove redundant check for
empty list, because First works also for empty list.
2024-05-07 Piotr Trojanek <trojanek@adacore.com>
* exp_ch4.adb (Useful): Remove redundant check for empty list,
because iteration with First works also for empty list; rename
local variable from L to Action.
2024-05-07 Piotr Trojanek <trojanek@adacore.com>
* inline.adb (Has_Formal_With_Per_Object_Constrained_Component):
Use flag Has_Per_Object_Constraint which is set by analysis;
rename for consistency.
2024-05-07 Piotr Trojanek <trojanek@adacore.com>
* sem_attr.adb (Analyze_Access_Attribute): Replace loop with
Current_Scope_No_Loops.
2024-05-07 Piotr Trojanek <trojanek@adacore.com>
* sem_attr.adb (Analyze_Access_Attribute): Move code to IF
branch where its result is used.
2024-05-07 Piotr Trojanek <trojanek@adacore.com>
* sem_attr.adb (Analyze_Access_Attribute): Prevent search from
going too far.
* sem_ch3.adb (Analyze_Component_Declaration): Remove
Contains_POC; reuse Has_Discriminant_Dependent_Constraint.
2024-05-07 Eric Botcazou <ebotcazou@adacore.com>
* einfo.ads (Pending_Access_Types): Delete.
* exp_ch3.adb (Freeze_Type.Process_Pending_Access_Types): Likewise.
(Freeze_Type): Do not call Process_Pending_Access_Types.
* exp_ch7.ads (Make_Set_Finalize_Address_Call): Delete.
* exp_ch7.adb (Build_Finalization_Master.Add_Pending_Access_Type):
Delete.
(Build_Finalization_Master): Do not set Finalize_Address on the
master or call Add_Pending_Access_Type.
(Make_Set_Finalize_Address_Call): Delete.
* gen_il-fields.ads (Opt_Field_Enum): Remove Pending_Access_Types.
* gen_il-gen-gen_entities.adb (Type_Kind): Likewise.
* rtsfind.ads (RE_Id): Remove RE_Set_Finalize_Address.
(RE_Unit_Table): Likewise.
* sem_ch3.adb (Analyze_Full_Type_Declaration): Do not deal with
pending access types.
* libgnat/s-finmas.ads (Attach_Unprotected): Add Finalize_Address
second parameter.
(Delete_Finalize_Address_Unprotected): Delete.
(Finalize_Address): Likewise.
(Finalize_Address_Unprotected): Likewise.
(Is_Homogeneous): Likewise.
(Set_Finalize_Address): Likewise.
(Set_Finalize_Address_Unprotected): Likewise.
(Set_Heterogeneous_Finalize_Address_Unprotected): Likewise.
(Set_Is_Heterogeneous): Likewise.
(FM_Node): Add Finalize_Address component.
(Finalization_Master): Remove Is_Homogeneous and Finalize_Address
components.
* libgnat/s-finmas.adb: Remove with & use clauses for System.HTable.
(Finalize_Address_Table): Delete.
(Attach_Unprotected): Add Finalize_Address second parameter and save
its value in the Finalize_Address field of the node.
(Delete_Finalize_Address_Unprotected): Delete.
(Finalize): Call Finalize_Address saved in the nodes.
(Finalize_Address): Delete.
(Finalize_Address_Unprotected): Likewise.
(Hash): Likewise.
(Is_Homogeneous): Likewise.
(Print_Master): Adjust.
(Set_Finalize_Address): Delete.
(Set_Finalize_Address_Unprotected): Likewise.
(Set_Heterogeneous_Finalize_Address_Unprotected): Likewise.
(Set_Is_Heterogeneous): Likewise.
* libgnat/s-stposu.adb (Finalize_Address_Table_In_Use): Likewise.
(Allocate_Any_Controlled): Pass Fin_Address to Attach_Unprotected
and remove obsolete processing.
(Deallocate_Any_Controlled): Remove obsolete processing.
(Set_Pool_Of_Subpool): Do not call Set_Is_Heterogeneous.
2024-05-07 Joffrey Huguet <huguet@adacore.com>
* libgnat/a-ngelfu.ads (Sqrt): Add Global contracts.
(Log): Likewise.
(Exp): Likewise.
("**"): Likewise.
(Sin): Likewise.
(Cos): Likewise.
(Tan): Likewise.
(Cot): Likewise.
(Arcsin): Likewise.
(Arccos): Likewise.
(Arctan): Likewise.
(Arccot): Likewise.
(Sinh): Likewise.
(Cosh): Likewise.
(Tanh): Likewise.
(Coth): Likewise.
(Arcsinh): Likewise.
(Arccosh): Likewise.
(Arctanh): Likewise.
(Arccoth): Likewise.
2024-05-07 Eric Botcazou <ebotcazou@adacore.com>
* einfo.ads (Postconditions_Proc): Delete.
* gen_il-fields.ads (Opt_Field_Enum): Remove Postconditions_Proc.
* gen_il-gen-gen_entities.adb (E_Function): Likewise.
(E_Procedure): Likewise.
(E_Entry): Likewise.
(E_Entry_Family): Likewise.
2024-05-07 Ronan Desplanques <desplanques@adacore.com>
* sinfo.ads: Fix typo.
2024-05-07 Bob Duff <duff@adacore.com>
* exp_attr.adb (Attribute_Old): The 'Old attribute we are
processing here is in a postcondition, which cannot be inside the
"Wrapped_Statements" of the subprogram with that postcondition. So
remove the loop labeled "Climb the parent chain looking for
subprogram _Wrapped_Statements". The only way this loop could find
a Subp is if we are nested inside a subprogram that also has a
postcondition, and in that case we would find the wrong (outer)
one. In any case, Subp is set to Empty after the loop, so all
subsequent tests for Present (Subp) are necessarily False; remove
them and the corresponding code. Set Ins_Node unconditionally (to
the right thing). Remove obsolete comments.
* sem_util.adb (Determining_Expressions): Fix assertion;
Pragma_Test_Case was missing.
(Eligible_For_Conditional_Evaluation): Fix assert that could fail
in case of errors.
* libgnat/s-valspe.ads: Remove pragma Unevaluated_Use_Of_Old;
there are no uses of 'Old in this package.
2024-05-07 Yannick Moy <moy@adacore.com>
* libgnat/a-strsea.adb (Index): Add assertions.
* libgnat/a-strsup.ads ("="): Remove useless precondition.
* libgnat/s-aridou.adb (Prove_Rounding_Case): Add assertions.
(Lemma_Shift_Right): Add call to lemma.
* libgnat/s-arit32.adb (Prove_Rounding_Case): Add assertion.
(Prove_ Signs): Add assertions.
(Scaled_Divide32): Add assertions.
2024-05-07 Steve Baird <baird@adacore.com>
* sem_prag.adb (Analyze_Pragma): Restructure the loop over
possible resolutions of a No_Return pragma's argument so that
functions (and generic functions) are not processed until after it
is known whether there is a non-function candidate resolution. For
a pre-2022 Ada version, terminate the iteration before processing
functions if a non-function resolution is found.
2024-05-07 Eric Botcazou <ebotcazou@adacore.com>
* libgnat/g-socthi.ads (C_Bind): Turn into inline function.
(C_Getpeername): Likewise.
(C_Getsockname): Likewise.
(C_Getsockopt): Likewise.
(C_Setsockopt): Likewise.
(Nonreentrant_Gethostbyaddr): Likewise.
* libgnat/g-socthi.adb (Syscall_Accept): Adjust profile.
(Syscall_Connect): Likewise.
(Syscall_Recvfrom): Likewise.
(Syscall_Sendto): Likewise.
(C_Bind): New function.
(C_Accept): Adjust to above change for profiles.
(C_Connect): Likewise.
(C_Getpeername): New function.
(C_Getsockname): Likewise.
(C_Getsockopt): Likewise.
(C_Recvfrom): Adjust to above change for profiles.
(C_Setsockopt): New function.
(Nonreentrant_Gethostbyaddr): Likewise.
2024-05-07 Bob Duff <duff@adacore.com>
* par-ch3.adb (P_Component_Items): Move P_Aspect_Specifications
into the loop, so aspects can be attached to multiple component
declarations.
(P_Type_Declaration, P_Subtype_Declaration)
(P_Known_Discriminant_Part_Opt): Remove default for Semicolon in
calls to P_Aspect_Specifications.
* gen_il-gen-gen_nodes.adb (N_Discriminant_Specification): Add
Aspect_Specifications field to N_Discriminant_Specification, which
was missing.
* aspects.adb (Has_Aspect_Specifications_Flag): Make it True for
N_Discriminant_Specification.
* par-ch13.adb: Remove default for Semicolon in calls to
P_Aspect_Specifications.
(Get_Aspect_Specifications): Misc cleanup.
(P_Aspect_Specifications): Remove comment. It's not clear what
"the flag" is referring to, but anyway the first part of the
comment is obvious, and the second part is apparently obsolete.
Misc cleanup.
* par.adb (P_Aspect_Specifications, Get_Aspect_Specifications):
Remove default for Semicolon; calls are more readable that way.
Improve comments.
* par-ch12.adb: Remove default for Semicolon in calls to
P_Aspect_Specifications.
* par-ch6.adb: Likewise.
* par-ch7.adb: Likewise.
* par-ch9.adb: Likewise.
* par-endh.adb: Likewise.
2024-05-07 Justin Squirek <squirek@adacore.com>
* sem_prag.adb (Defer_Compile_Time_Warning_Error_To_BE): Better
handle itypes such that the tree copy required for the expansion
of the pragma doesn't cause ordering problems with internal names.
2024-05-07 Yannick Moy <moy@adacore.com>
* sem_res.adb (Resolve_Actuals): Add range check flag.
2024-05-07 Yannick Moy <moy@adacore.com>
* sem_util.adb (Find_Placement_In_State_Space): Stop search for
placement when reaching the public state of a generic package.
2024-05-07 Javier Miranda <miranda@adacore.com>
* sem_ch3.adb (Check_Return_Subtype_Indication): Add missing check
on statically compatible subtypes.
* sem_eval.adb (Subtypes_Statically_Compatible): Ensure that both
types are either scalar types or access types to evaluate this
predicate.
2024-05-07 Bob Duff <duff@adacore.com>
* sem_ch13.adb (Resolve_Name): Clarify comment.
2024-05-07 Bob Duff <duff@adacore.com>
* sem_ch13.adb (Resolve_Name): This is called only for names in
aspect_specifications. If the name is an overloaded
selected_component, reset the Entity. Note that this was already
done for N_Identifier in the code just below.
2024-05-07 Eric Botcazou <ebotcazou@adacore.com>
* repinfo.adb (List_Record_Info.List_Structural_Record_Layout): Add
another guard for private types after retrieving the parent in the
extension case.
2024-05-07 Yannick Moy <moy@adacore.com>
* sem_util.adb (Is_Volatile_Function): Return True on functions
with side effects.
2024-05-07 Piotr Trojanek <trojanek@adacore.com>
* sem_prag.adb (Analyze_Global_Item): Handle side-effect
functions like procedures.
2024-05-07 Piotr Trojanek <trojanek@adacore.com>
* sem_prag.adb (Collect_Global_Item): Update comment.
2024-05-06 Piotr Trojanek <trojanek@adacore.com>
* sem_prag.adb (Collect_Global_Item): Handle functions with
side-effects.
2024-05-06 Piotr Trojanek <trojanek@adacore.com>
* sem_prag.adb (Collect_Global_Item): Move code.
2024-05-06 Piotr Trojanek <trojanek@adacore.com>
* sem_prag.adb (Find_Role): Handle functions with side-effects
like procedures.
2024-05-06 Gary Dismukes <dismukes@adacore.com>
* exp_ch6.adb
(Make_Build_In_Place_Iface_Call_In_Object_Declaration): Set the
Is_Return_Object flag on the entity of the temp object created to
hold the BIP call result, from the flag on the passed-in object
declaration's entity. Update copyright notice to 2024.
2024-05-06 Bob Duff <duff@adacore.com>
* sem_ch10.adb (Expand_With_Clause): Misc cleanup.
(Install_Private_With_Clauses): Avoid installing a private
with_clause that comes from an instantiated generic
(it is marked as Implicit_With, but doesn't come from a parent
with). Fix typo in comment, and other minor cleanups.
2024-05-06 Ronan Desplanques <desplanques@adacore.com>
* sem_util.adb (Build_Default_Subtype): Tweak source location
information.
2024-05-06 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch7.adb (Build_Finalizer.Process_Declarations): Do not call
Processing_Actions for simple protected objects if the profile is
restricted.
* exp_util.adb (Requires_Cleanup_Actions): Do not return True for
simple protected objects if the profile is restricted.
2024-05-06 Eric Botcazou <ebotcazou@adacore.com>
* fe.h: Remove unused declarations and add 'extern' to others.
2024-05-06 Piotr Trojanek <trojanek@adacore.com>
* einfo-utils.adb (Is_Relaxed_Initialization_State): Remove.
* einfo-utils.ads (Is_Relaxed_Initialization_State): Remove.
* einfo.ads: Remove description of removed aspect.
* fe.h (Is_Relaxed_Initialization_State): Remove.
* sem_prag.adb (Analyze_Abstract_State): Remove support for
Relaxed_Initialization.
* sem_util.adb (Has_Relaxed_Initialization): Likewise.
* sem_util.ads (Has_Relaxed_Initialization): Likewise.
2024-05-06 Justin Squirek <squirek@adacore.com>
* sem_warn.adb (Within_Postcondition): Add coverage for
Preconditions
2024-05-06 Justin Squirek <squirek@adacore.com>
* sem_warn.adb (Within_Postcondition): Add/modify comments to
document various cases.
2024-05-06 Justin Squirek <squirek@adacore.com>
* sem_warn.adb (Within_Postcondition): Renamed to
Within_Contract_Or_Predicate.
2024-05-06 Justin Squirek <squirek@adacore.com>
* sem_warn.adb (Within_Postcondition): Add case to ignore
references within generated predicate function calls.
2024-05-06 Ronan Desplanques <desplanques@adacore.com>
* hostparm.ads: Fix reference to RM clause.
2024-05-06 Eric Botcazou <ebotcazou@adacore.com>
* libgnat/s-finpri.ads (Finalize_Master): Remove obsolete reference
in the description.
(Finalize_Object): Document the effects of repeated calls.
2024-05-06 Eric Botcazou <ebotcazou@adacore.com>
* einfo.ads (Finalization_Master_Node_Or_Object): Rename into...
(Finalization_Master_Node): ...this and adjust description.
* exp_ch4.adb (Process_Transient_In_Expression): Attach the object
to its master node here.
* exp_ch7.ads (Attach_Object_To_Master_Node): New declaration.
* exp_ch7.adb (Attach_Object_To_Master_Node): New procedure.
(Build_Finalizer.Process_Declarations): Examine the type of a
variable to spot master nodes.
(Build_Finalizer.Process_Object_Declaration): Look only at the
object and deal specifically with the case of a master node.
(Build_Finalizer.Build_BIP_Cleanup_Stmts): Move to child function
of Attach_Object_To_Master_Node.
(Build_Finalizer.Make_Address_For_Finalize): Move to...
(Insert_Actions_In_Scope_Around.Process_Transient_In_Scope): Attach
the object to its master node here.
(Make_Address_For_Finalize): ...here.
(Make_Master_Node_Declaration): Adjust to above renaming and set
Finalization_Master_Node only on the object.
(Make_Suppress_Object_Finalize_Call): Adjust to above renaming and
attach the object to its master node here.
* exp_util.adb (Requires_Cleanup_Actions): Examine the type of a
variable to spot master nodes.
* gen_il-fields.ads (Opt_Field_Enum): Adjust to above renaming.
* gen_il-gen-gen_entities.adb (Allocatable_Kind): Likewise.
* rtsfind.ads (RE_Id): Add RE_Chain_Node_To_Master.
(RE_Unit_Table): Add entry for RE_Chain_Node_To_Master.
* libgnat/s-finpri.ads (Chain_Node_To_Master): New declaration.
* libgnat/s-finpri.adb (Chain_Node_To_Master): New procedure.
(Attach_Object_To_Master): Call it.
(Finalize_Master): Do not raise Program_Error on null addresses.
(Finalize_Object): Add assertion that the address is not null.
2024-05-06 Eric Botcazou <ebotcazou@adacore.com>
* libgnarl/s-taprob.ads (Protection): Add cross-reference to the
counterpart in System.Tasking.Protected_Objects.Entries.
* libgnarl/s-taskin.ads (Locking Rules): Replace PO_Simple by
Protected_Objects.
* libgnarl/s-tpoben.ads (Protection_Entries): Likewise.
2024-05-06 Eric Botcazou <ebotcazou@adacore.com>
* exp_attr.adb (Expand_N_Attribute_Reference) <Finalization_Size>:
Return 0 if the prefix is a dereference of an access value subject
to the No_Heap_Finalization pragma.
2024-05-06 Ronan Desplanques <desplanques@adacore.com>
* exp_imgv.adb (Append_Table_To): Remove reference to removed
field.
* gen_il-fields.ads: Remove Is_Enum_Array_Aggregate field.
* gen_il-gen-gen_nodes.adb: Likewise.
* sem_aggr.adb: Tweak warning emission condition.
* sinfo.ads: Remove documentation for Is_Enum_Array_Aggregate.
2024-05-06 Piotr Trojanek <trojanek@adacore.com>
* make.adb (Scan_Make_Arg): Remove redundant condition.
* switch-b.adb (Scan_Debug_Switches): Likewise.
* switch-c.adb (Scan_Front_End_Switches): Likewise.
2024-05-06 Yannick Moy <moy@adacore.com>
* inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Add guard.
2024-05-06 Piotr Trojanek <trojanek@adacore.com>
* exp_pakd.adb (Create_Packed_Array_Impl_Type): Set associated
node for the packed array itype.
* exp_util.adb (Possible_Side_Effect_In_SPARK): Remove
workaround for a missing associated node.
2024-05-06 Richard Kenner <kenner@adacore.com>
* freeze.adb (Freeze_Entity): When changing the convention of
primitive to match that of the type, only do this for user-specified
primitives.
2024-05-06 Bob Duff <duff@adacore.com>
* exp_put_image.adb (Build_Image_Call): Call Set_Uses_Sec_Stack on
the current scope. We don't do this at all call sites, because
there are three; better to do it here.
2024-05-06 Eric Botcazou <ebotcazou@adacore.com>
* sem_attr.adb (Analyze_Attribute) <Attribute_Round>: Also accept it
for ordinary fixed point types.
* doc/gnat_rm/implementation_defined_attributes.rst (Round): New.
* gnat_rm.texi: Regenerate.
2024-05-06 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch3.adb (Expand_Freeze_Class_Wide_Type): Use No instead of
not Present.
2024-05-06 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch7.adb (Build_Finalizer.Process_Object_Declaration): Adjust
the Sloc of the master node declaration in the degenerate case.
2024-05-06 Yannick Moy <moy@adacore.com>
* inline.adb (Call_Can_Be_Inlined_In_GNATprove_Mode):
Add case to prevent inlining of call.
* inline.ads: Likewise.
* sem_res.adb (Resolve_Call): Update comment and message.
2024-05-06 Eric Botcazou <ebotcazou@adacore.com>
* Makefile.rtl (GNATRTL_NONTASKING_OBJS): Add s-finpri$(objext).
* contracts.adb (Add_Call_Helper): Append freeze actions to the
class-wide type rather than the specific tagged type.
* einfo.ads (Finalization_Master_Node_Or_Node): Document.
(Status_Flag_Or_Transient_Decl): Remove.
* exp_attr.adb (Expand_N_Attribute_Reference) <Address>: Do not
adjust a return object of a class-wide interface type.
* exp_ch3.adb (Expand_Freeze_Class_Wide_Type): Add test that
Finalize_Address is not already present as a condition for calling
Make_Finalize_Address_Body.
(Expand_Freeze_Record_Type): Call Make_Finalize_Address_Body for
class-wide types of both regular tagged types and interface types.
* exp_ch4.adb (Process_Transients_In_Expression): Replace the use
of hooks with the use of master nodes.
* exp_ch6.adb (Build_Flag_For_Function): Delete.
(Expand_N_Extended_Return_Statement): Create a master node for the
return object if it does not exist. At the end of the statement,
generate a call to Suppress_Object_Finalize.
(Expand_Non_Function_Return): Likewise just before the return.
* exp_ch7.ads (Make_Master_Node_Declaration): Declare.
(Make_Suppress_Object_Finalize_Call): Likewise.
* exp_ch7.adb (Build_Finalization_Master): Defer generating the
call to Set_Finalize_Address until freezing if the Finalize_Address
procedure has not been analyzed yet.
(Build_Finalizer): Reimplement the expansion using a finalization
scope master per finalizer.
(Insert_Actions_In_Scope_Around): Replace finalization hooks by
master nodes and calls to the Finalize_Object.
(Make_Master_Node_Declaration): New procedure.
(Make_Suppress_Object_Finalize_Call): Likewise.
* exp_util.ads (Build_Transient_Object_Statements): Delete.
* exp_util.adb (Build_Transient_Object_Statements): Likewise.
(Requires_Cleanup_Actions): Remove obsolete code and return true
for master nodes.
* gen_il-fields.ads (Opt_Field_Enum): Add
Finalization_Master_Node_Or_Object and
remove Status_Flag_Or_Transient_Decl.
* gen_il-gen-gen_entities.adb (Allocatable_Kind): Likewise.
* rtsfind.ads (RTU_Id): Add System_Finalization_Primitives.
(RE_Id): Add entities of System_Finalization_Primitives.
(RE_Unit_Table): Add entries for them.
* sem_ch3.adb (Analyze_Object_Declaration): For an array whose type
has an unconstrained first subtype and a controlled component, set
the Is_Constr_Array_Subt_With_Bounds flag.
* libgnat/s-finpri.ads: New file.
* libgnat/s-finpri.adb: Likewise.
2024-05-06 Yannick Moy <moy@adacore.com>
* inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Adapt checking.
2024-04-26 Jakub Jelinek <jakub@redhat.com>
* gnatvsn.ads: Bump Library_Version to 15.
2024-04-15 Piotr Trojanek <trojanek@adacore.com>
* doc/gnat_rm/implementation_defined_aspects.rst
(Exceptional_Cases): Add description for aspect.
* doc/gnat_rm/implementation_defined_pragmas.rst
(Exceptional_Cases): Add description for pragma.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2024-03-07 Eric Botcazou <ebotcazou@adacore.com>
PR ada/113979
* exp_ch4.adb (Expand_N_Allocator): In the subtype indication case,
call Apply_Predicate_Check on the resulting access value if needed.
2024-02-26 Eric Botcazou <ebotcazou@adacore.com>
PR ada/113893
* exp_ch7.adb (Build_Anonymous_Master): Do not build the master
for a local designated type.
* exp_util.adb (Build_Allocate_Deallocate_Proc): Force Needs_Fin
to false if no finalization master is attached to an access type
and assert that it is anonymous in this case.
* sem_res.adb (Resolve_Allocator): Mention that the object might
not be finalized at all in the warning given when the type is an
anonymous access-to-controlled type.
2024-01-23 Ronan Desplanques <desplanques@adacore.com>
* gnatvsn.ads: Update year.
2024-01-09 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Array_Type>: Use the
TYPE_CANONICAL of types when it comes to aliasing.
* gcc-interface/utils.cc (relate_alias_sets): Likewise.
2024-01-09 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Array_Type>: Use a
separate FLD local variable to hold the first field of the fat
pointer type being built.
* gcc-interface/gigi.h (relate_alias_sets): Remove GNU_ prefix on
the first two parameters.
* gcc-interface/utils.cc (relate_alias_sets): Likewise and adjust.
2024-01-09 Viljar Indus <indus@adacore.com>
* sem_attr.adb: avoid marking a use of the Address attribute
as a modification of its prefix.
2024-01-09 Gary Dismukes <dismukes@adacore.com>
* exp_aggr.adb (Expand_Container_Aggregate): Change "not Present"
tests to tests using "No" (in two places).
2024-01-09 Bob Duff <duff@adacore.com>
* sem_ch12.adb (Instantiate_Type): Make the relevant error message
conditional upon "Ekind (A_Gen_T) /= E_Incomplete_Type". Misc
cleanup.
2024-01-09 Gary Dismukes <dismukes@adacore.com>
* exp_aggr.adb (Expand_Container_Aggregate): Add code to determine
whether the aggregate is an indexed aggregate, setting a flag
(Is_Indexed_Aggregate), which is tested to have proper separation
of treatment for the Add_Unnamed
(for positional aggregates) and New_Indexed (for indexed
aggregates) cases. In the code generating associations for indexed
aggregates, remove the code for Expressions cases entirely, since
the code for indexed aggregates is governed by the presence of
Component_Associations, and add an assertion that Expressions must
be Empty. Also, exclude empty aggregates from entering that code.
2024-01-09 Eric Botcazou <ebotcazou@adacore.com>
* rtsfind.ads (RE_Id): Remove RE_Attach.
(RE_Unit_Table): Likewise.
* libgnat/s-finmas.ads (Attach): Delete.
* libgnat/s-finmas.adb (Attach): Likewise.
2024-01-09 Tucker Taft <taft@adacore.com>
* pprint.adb (List_Name): Check for "Box_Present" when displaying
a list, and emit "<>" if returns True.
* sem_scil.adb (Check_SCIL_Node): Handle case when the type of a
parameter is from a package that was mentioned in a limited with
clause, and make no further checks, since this check routine does
not have all the logic to check such a usage.
2024-01-09 Eric Botcazou <ebotcazou@adacore.com>
* freeze.adb (Freeze_Expression.Has_Decl_In_List): Deal specifically
with itypes that are class-wide subtypes.
2024-01-09 Eric Botcazou <ebotcazou@adacore.com>
* libgnat/s-atopri.ads (Atomic_Store): New generic procedure.
(Atomic_Store_8): New instantiated procedure.
(Atomic_Store_16): Likewise.
(Atomic_Store_32): Likewise.
(Atomic_Store_64): Likewise.
* libgnat/s-atopri__32.ads (Atomic_Store): New generic procedure.
(Atomic_Store_8): New instantiated procedure.
(Atomic_Store_16): Likewise.
(Atomic_Store_32): Likewise.
* gcc-interface/decl.cc (gnat_to_gnu_subprog_type): Implement the
support for __atomic_store_n and __sync_bool_compare_and_swap_n.
* gcc-interface/gigi.h (list_second): New inline function.
2024-01-09 Javier Miranda <miranda@adacore.com>
* sem_ch6.adb (Analyze_Subprogram_Specification): Do not replace
the type of the formals with its corresponding record in
init-procs.
* sem_ch9.adb (Analyze_Requeue): Add missing support to requeue to
a procedure that denotes a renaming of an entry.
2024-01-09 Piotr Trojanek <trojanek@adacore.com>
* exp_util.adb (Possible_Side_Effect_In_SPARK): Refine handling of
itype declarations.
2024-01-09 Piotr Trojanek <trojanek@adacore.com>
* sem_ch6.adb (Analyze_Subprogram_Specification): Set Is_Inlined
flag by default in GNATprove mode.
* sem_res.adb (Resolve_Call): Only look at flag which is cleared
when inlined subprogram is detected to be recursive.
2024-01-09 Piotr Trojanek <trojanek@adacore.com>
* inline.adb (Establish_Actual_Mapping_For_Inlined_Call):
Remove detection of recursive calls.
2024-01-09 Piotr Trojanek <trojanek@adacore.com>
* inline.adb (Cannot_Inline): Cleanup use of 'Length; remove
dead code.
2024-01-09 Piotr Trojanek <trojanek@adacore.com>
* sem_aggr.adb (Resolve_Container_Aggregate): Use "No".
* sem_ch8.adb (Find_Direct_Name): Likewise.
2024-01-09 Steve Baird <baird@adacore.com>
* sem_util.adb (Enclosing_Declaration): Instead of returning a
subprogram specification node, return its parent (which is
presumably a subprogram declaration).
* contracts.adb (Insert_Stable_Property_Check): Remove code
formerly needed to compensate for incorrect behavior of
Sem_Util.Enclosing_Declaration.
* exp_attr.adb (In_Available_Context): Remove code formerly needed
to compensate for incorrect behavior of
Sem_Util.Enclosing_Declaration.
* sem_ch8.adb (Is_Actual_Subp_Of_Inst): Remove code formerly
needed to compensate for incorrect behavior of
Sem_Util.Enclosing_Declaration.
2024-01-09 Steve Baird <baird@adacore.com>
* sem_ch8.adb (Check_Constrained_Object): Before updating the
subtype mark of an object renaming declaration by calling Rewrite,
first check whether the destination of the Rewrite call exists.
* atree.adb (Copy_Slots): Return without performing any updates if
Destination equals Empty or Error, or if Source equals Empty. Any
of those conditions indicates an error case.
* sem_ch12.adb (Analyze_Formal_Derived_Type): Avoid cascading
errors.
* sem_ch3.adb (Analyze_Number_Declaration): In an error case, do
not pass Error as destination in a call to Rewrite.
(Find_Type_Of_Subtype_Indic): In an error case, do not pass Error
or Empty as destination in a call to Rewrite.
2024-01-09 Joffrey Huguet <huguet@adacore.com>
* libgnat/i-cstrin.ads (Update): Fix precondition.
2024-01-09 Eric Botcazou <ebotcazou@adacore.com>
* sem_aggr.adb (Resolve_Extension_Aggregate): Remove the unreachable
call to Transform_BIP_Assignment as well as the procedure.
2024-01-09 Bob Duff <duff@adacore.com>
* lib-xref.adb (Generate_Reference): Do not count it as a read
reference if we're calling a TSS.
2024-01-09 Piotr Trojanek <trojanek@adacore.com>
* doc/gnat_rm/implementation_defined_aspects.rst,
doc/gnat_rm/implementation_defined_pragmas.rst: Add sections for
Always_Terminates.
* gnat-style.texi: Regenerate.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2024-01-09 Eric Botcazou <ebotcazou@adacore.com>
PR ada/78207
* libgnat/g-regexp.ads: Fix outdated comment.
2024-01-09 Eric Botcazou <ebotcazou@adacore.com>
PR ada/112781
* exp_ch6.ads (Is_Build_In_Place_Function): Adjust description.
* exp_ch6.adb (Is_True_Build_In_Place_Function_Call): Delete.
(Is_Function_Call_With_BIP_Formals): New predicate.
(Is_Build_In_Place_Function_Call): Restore original semantics.
(Expand_Call_Helper): Adjust conditions guarding the calls to
Add_Dummy_Build_In_Place_Actuals to above renaming.
(Expand_N_Extended_Return_Statement): Adjust to above renaming.
(Expand_Simple_Function_Return): Likewise. Move the assertion
to after the transformation into an extended return statement.
(Make_Build_In_Place_Call_In_Allocator): Remove unreachable code.
(Make_Build_In_Place_Call_In_Assignment): Likewise.
2024-01-09 Eric Botcazou <ebotcazou@adacore.com>
PR ada/112781
* sem_ch12.adb (Instantiate_Type): Use Etype instead of Base_Type
consistently to retrieve the ancestor for a derived type.
* sem_ch4.adb (Analyze_Explicit_Dereference): Test Is_Access_Type
consistently before accessing Designated_Type.
2024-01-09 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/utils2.cc (build_binary_op) <EQ_EXPR>: Relax
assertion for regular pointer types.
2024-01-04 David Malcolm <dmalcolm@redhat.com>
* gcc-interface/lang.opt.urls: New file, autogenerated by
regenerate-opt-urls.py.
2024-01-03 Jakub Jelinek <jakub@redhat.com>
* gnat_ugn.texi: Bump @copying's copyright year.
* gnat_rm.texi: Likewise.
Copyright (C) 2024 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.
|