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
|
2025-06-12 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Variable>: Generate
a zero-initialization for the anonymous object of a small aggregate
allocated on the stack.
(inline_status_for_subprog): Minor tweak.
2025-06-12 Tonu Naks <naks@adacore.com>
* comperr.adb: update support instructions
* switch.adb: update support instructions
2025-06-12 Ronan Desplanques <desplanques@adacore.com>
* sinfo.ads: Fix RM reference.
2025-06-12 Piotr Trojanek <trojanek@adacore.com>
* sem_ch3.adb (Apply_External_Initialization): Reuse local constant.
2025-06-12 Eric Botcazou <ebotcazou@adacore.com>
* doc/gnat_rm/gnat_language_extensions.rst
(Generalized Finalization): Document the actual implementation.
(No_Raise): Move to separate section.
* gnat_rm.texi: Regenerate.
2025-06-12 Ronan Desplanques <desplanques@adacore.com>
* libgnat/s-valuer.adb (Scan_Raw_Real): Apply tweak.
2025-06-12 Tonu Naks <naks@adacore.com>
* comperr.adb: replace report@ with support@
* gnatcmd.adb: replace report@ with support@
2025-06-12 Ronan Desplanques <desplanques@adacore.com>
* sem_ch3.adb (Build_Derived_Private_Type): Fix test.
(Build_Derived_Record_Type): Adjust error recovery paths.
2025-06-12 Eric Botcazou <ebotcazou@adacore.com>
* einfo.ads (Has_Homonym): Fix inaccuracy in description.
* sem_ch8.ads (Find_Direct_Name): Remove obsolete description.
* sem_ch12.adb (Analyze_Associations): Rename I_Node parameter
into N and adjust description.
(Analyze_Subprogram_Instantiation): Add missing description.
(Contains_Instance_Of): Fix description.
(Associations): Rename Generic_Actual_Rec into Actual_Rec and
Gen_Assocs_Rec into Match_Rec.
(Analyze_One_Association): Rename I_Node parameter into N.
(Check_Fixed_Point_Warning): Rename Gen_Assocs parameter into
Match.
(Body of Associations): Minor cleanups and tweaks.
(Analyze_Associations): Rename I_Node parameter into N and
adjust implementation.
(Analyze_One_Association): Likewise.
(Analyze_Package_Instantiation): Remove obsolete code and clean up.
(Check_Fixed_Point_Warning): Rename Gen_Assocs parameter into
Match and adjust implementation.
(Freeze_Package_Instance): Simplify condition.
(Get_Unit_Instantiation_Node): Add support for instantiations of
subprograms and stop the loop properly in case of errors.
* sem_util.ads (Add_Global_Declaration): Rename N parameter into
Decl and fix description.
* sem_util.adb (Add_Global_Declaration): Rename N parameter into
Decl and adjust implementation.
2025-06-12 Ronan Desplanques <desplanques@adacore.com>
* libgnat/s-valuer.adb (Scan_Raw_Real): Add RM reference.
2025-06-12 Ronan Desplanques <desplanques@adacore.com>
* libgnat/s-valuer.adb (Scan_Raw_Real): Remove subexpression. Improve
surrounding comments.
2025-06-12 Bob Duff <duff@adacore.com>
* vast.adb: Check basic tree properties.
* atree.adb (Traverse_Field): Minor.
* treepr.adb (Destroy): Minor comment.
2025-06-12 Eric Botcazou <ebotcazou@adacore.com>
* libgnat/s-valuer.adb (Round_Extra): Use multiplicative test.
2025-06-12 Ronan Desplanques <desplanques@adacore.com>
* einfo-utils.adb (Set_Convention): Remove obsolete test.
2025-06-12 Ronan Desplanques <desplanques@adacore.com>
* sem_ch3.adb (Process_Discriminants): Set Ekind earlier.
* sem_util.adb (Enter_Name): Adjust error processing.
2025-06-12 Eric Botcazou <ebotcazou@adacore.com>
* libgnat/s-valuef.adb (Integer_To_Fixed): Enable overflow checks.
Deal specifically with Val = 2**(Int'Size - 1) if Minus is not set.
Exit the loop when V saturates to 0 in the case of (huge) negative
exponents.
2025-06-12 Ronan Desplanques <desplanques@adacore.com>
* exp_util.adb (Insert_Actions): Refine test.
2025-06-12 Eric Botcazou <ebotcazou@adacore.com>
* doc/gnat_ugn/building_executable_programs_with_gnat.rst (Compiler
switches) <-O>: Fix long line.
* gnat_ugn.texi: Regenerate.
2025-06-12 Eric Botcazou <ebotcazou@adacore.com>
* doc/gnat_ugn/building_executable_programs_with_gnat.rst (List of
all switches): Add -gnatRh subswitch.
(Debugging Control): Document -gnatRh subswitch.
* opt.ads (List_Representation_Info_Holes): New boolean variable.
* repinfo.adb: Add with clause for GNAT.Heap_Sort_G.
(List_Common_Type_Info): Relax assertion.
(List_Object_Info): Replace assertion with additional test.
(List_Record_Layout): If -gnatRh is specified, make sure that the
components are ordered by increasing offsets. Output a comment
line giving the number of unused bits if there is a hole between
consecutive components. Streamline the control flow of the loop.
(List_Record_Info): Use the original record type giving the layout
of components, if any, to display the layout of the record.
* switch-c.adb (Scan_Front_End_Switches) <-gnatR>: Add support for
-gnatRh subswitch.
* usage.adb (Usage): Document -gnatRh subswitch.
* gnat_ugn.texi: Regenerate.
2025-06-12 Johannes Kliemann <kliemann@adacore.com>
* libgnat/s-secsta.adb (SS_Allocate): Add comment about
conservative alignment padding calculation.
* libgnat/s-secsta__cheri.adb (SS_Allocate): Add comment about
conservative alignment padding calculation.
2025-06-12 Ronan Desplanques <desplanques@adacore.com>
* sem_warn.adb (Check_References): Rewrite expression
2025-06-12 Ronan Desplanques <desplanques@adacore.com>
* sem_ch3.adb (Constrain_Index, Make_Index, Array_Type_Declaration,
Analyze_Number_Declaration): Remove uses of E_Void.
2025-06-12 Eric Botcazou <ebotcazou@adacore.com>
* usage.adb (Usage): Justify the documentation of common switches
like that of other switches. Rework that of the -O switch.
* doc/gnat_ugn/building_executable_programs_with_gnat.rst (Compiler
switches) <-O>: Rework and document 'z' and 'g' operands.
* doc/gnat_ugn/gnat_and_program_execution.rst (Optimization Levels):
Rework and document -Oz and -Og switches.
* gnat_ugn.texi: Regenerate.
2025-06-12 Ronan Desplanques <desplanques@adacore.com>
* sem_ch3.adb (Constrain_Index): Avoid unused itypes.
2025-06-12 Ronan Desplanques <desplanques@adacore.com>
* sem_ch3.adb (Constrain_Index): Factorize return statement.
2025-06-12 Ronan Desplanques <desplanques@adacore.com>
* sem_ch3.adb (Build_Derived_Numeric_Type): Remove duplicate call.
2025-06-10 Piotr Trojanek <trojanek@adacore.com>
* gen_il-gen-gen_entities.adb (Formal_Object_Kind): Remove
Entry_Component field.
2025-06-10 Piotr Trojanek <trojanek@adacore.com>
* sem_attr.adb (Resolve_Attribute): Remove redundant guard.
2025-06-10 Eric Botcazou <ebotcazou@adacore.com>
* inline.adb (Analyze_Inlined_Bodies): Minor comment tweak.
2025-06-10 Eric Botcazou <ebotcazou@adacore.com>
* inline.adb (Instantiate_Body): Do not call Add_Scope_To_Clean if
the main unit is generic.
(Instantiate_Bodies): Do not deal with generic main units here.
* sem_ch12.adb (Need_Subprogram_Instance_Body): Return false if the
main unit is generic.
2025-06-10 Eric Botcazou <ebotcazou@adacore.com>
* Makefile.rtl (ADA_EXCLUDE_SRCS): Add the 128-bit support files.
2025-06-10 Ronan Desplanques <desplanques@adacore.com>
* sem_ch3.adb (Process_Subtype): Factorize code.
2025-06-10 Bob Duff <duff@adacore.com>
* einfo.ads (Associated_Node_For_Itype): Document that
Parent field may be empty.
* vast.adb: Allow empty Parent in Itypes.
2025-06-10 Gary Dismukes <dismukes@adacore.com>
* einfo.ads: Revise comment about Dynamic_Predicate flag to make it
more accurate.
* sem_case.adb (Check_Choices): Test "not Has_Static_Predicate_Aspect"
as additional guard for error about use of subtype with nonstatic
predicate as a case choice. Improve related error message.
2025-06-10 Tonu Naks <naks@adacore.com>
* libgnat/s-valueu.adb: add explict raise
* libgnat/s-valueu.ads: update annotation
2025-06-10 Ronan Desplanques <desplanques@adacore.com>
* sem_ch6.adb, sem_ch6.ads (Check_Discriminant_Conformance): Move to …
* sem_ch3.adb (Check_Discriminant_Conformance): … here.
2025-06-10 Eric Botcazou <ebotcazou@adacore.com>
* freeze.adb (Freeze_Static_Object): Do not issue any error message
for compiler-generated entities.
2025-06-10 Bob Duff <duff@adacore.com>
* vast.adb: Implement two checks. Improve debugging
outputs.
2025-06-10 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch4.adb (Insert_Conditional_Object_Declaration): Deal with a
transient scope being created around the declaration.
* freeze.adb (Freeze_Entity): Do not call Freeze_Static_Object for
a renaming declaration.
2025-06-10 Eric Botcazou <ebotcazou@adacore.com>
* libgnat/s-vafi32.ads: Fix head description.
* libgnat/s-vafi64.ads: Likewise.
* libgnat/s-vafi128.ads: Likewise.
2025-06-10 Bob Duff <duff@adacore.com>
* vast.adb: Initial implementation.
* vast.ads: Rename procedure. Remove parameter; body should decide
what to do.
* lib.ads (ipu): Minor: Rewrite comment for brevity, and because
of an inconvenient misspelling.
(Num_Units): Not used; remove.
(Remove_Unit): Minor: Remove "Currently" (which was current a decade
ago from) comment.
* lib.adb (Num_Units): Not used; remove.
* debug_a.adb (Debug_A_Entry): Fix bug: Use Write_Name_For_Debug,
so this won't crash on the Error node.
* debug.adb: Document -gnatd_V and -gnatd_W compiler switches.
* exp_ch6.adb (Validate_Subprogram_Calls): Remove redundant check for
Serious_Errors_Detected. (We turn off code gen when errors are
detected.)
* frontend.adb: Move decisions into VAST body.
* namet.ads (Present): Remove unnecessary overriding; these are
inherited by the derived types.
* namet.adb (Present): Likewise.
2025-06-10 Gary Dismukes <dismukes@adacore.com>
* exp_aggr.adb (Build_Container_Aggr_Code.To_Int): Apply Enumeration_Pos
to Entity (Expr) rather than Expr.
2025-06-10 Ronan Desplanques <desplanques@adacore.com>
* sem_ch3.adb (Find_Type_Of_Object): Fix comment.
2025-06-10 Ronan Desplanques <desplanques@adacore.com>
* sem_ch3.adb (Analyze_Component_Declaration): Rename constant.
2025-06-10 Ronan Desplanques <desplanques@adacore.com>
* sem_ch3.adb (Constrain_Array): Simplify.
(Process_Subtype): Adjust.
2025-06-10 Eric Botcazou <ebotcazou@adacore.com>
* sem_ch12.adb (Copy_Generic_Node): Do not call Root_Type to find
the root type of an aggregate of a derived tagged type.
2025-06-10 Ronan Desplanques <desplanques@adacore.com>
* libgnarl/s-stusta.adb (Compute_All_Tasks): Skip terminated tasks.
2025-06-10 Viljar Indus <indus@adacore.com>
* sem_prag.adb (Is_Configuration_Pragma): Check that nodes
preceding the pragma are pragma nodes or originally were
pragma nodes.
2025-06-10 Eric Botcazou <ebotcazou@adacore.com>
* libgnat/s-valued.adb (Integer_to_Decimal): Add Extra parameter and
use its value to call Bad_Value on boundary values.
(Scan_Decimal): Adjust call to Integer_to_Decimal.
(Value_Decimal): Likewise.
2025-06-10 Ronan Desplanques <desplanques@adacore.com>
* sem_ch3.ads (Process_Subtype): New formal.
* sem_ch3.adb (Process_Subtype): Likewise.
(Analyze_Subtype_Declaration, Access_Type_Declaration): Use new
formal.
2025-06-10 Ronan Desplanques <desplanques@adacore.com>
* sem_ch3.adb (Process_Subtype): Fix recursive call.
2025-06-10 Eric Botcazou <ebotcazou@adacore.com>
* par-ch5.adb (P_Declare_Statement): Rename local variable.
(P_Begin_Statement): Likewise.
2025-06-10 Piotr Trojanek <trojanek@adacore.com>
* einfo.ads (Overridden_Operation, Static_Initialization): Remove
comments about a reused entity field.
2025-06-10 Ronan Desplanques <desplanques@adacore.com>
* sem_ch3.adb (Process_Subtype): Tweak formatting.
2025-06-10 Ronan Desplanques <desplanques@adacore.com>
* sem_ch3.adb (Process_Subtype): Add assertion.
2025-06-10 Ronan Desplanques <desplanques@adacore.com>
* sem_ch3.adb (Process_Subtype): Factorize initialization of variable.
2025-06-09 Gary Dismukes <dismukes@adacore.com>
* sem_ch3.adb (Constrain_Index): In the case of a fixed-lower-bound index,
set Etype of the newly created itype's Scalar_Range from the index's Etype.
* sem_ch12.adb (Validate_Array_Type_Instance): If the actual subtype is
a fixed-lower-bound type, then check again the Etype of its Scalar_Range.
2025-06-09 Piotr Trojanek <trojanek@adacore.com>
* sem_prag.adb (Analyze_Pragma): Fix conditions for legality checks on
formal type declarations.
2025-06-09 Piotr Trojanek <trojanek@adacore.com>
* sem_prag.adb (Analyze_Pragma): If pragmas apply to a formal array
type, then set the flags on the base type.
2025-06-09 Ronan Desplanques <desplanques@adacore.com>
* sem_ch3.adb (Process_Subtype): Clarify code.
2025-06-09 Ronan Desplanques <desplanques@adacore.com>
* sem_ch3.ads (Process_Subtype): Add formal.
* sem_ch3.adb (Process_Subtype): Use new formal.
(Analyze_Subtype_Declaration, Array_Type_Declaration,
Build_Derived_Access_Type): Pass new actual.
* sem_ch4.adb (Find_Type_Of_Object): Likewise.
2025-06-09 Ronan Desplanques <desplanques@adacore.com>
* sem_ch6.adb (Set_Formal_Mode): Extend profile. Move parts of the
body…
(Process_Formals): … here. Move call to Set_Formal_Mode earlier. Call
Set_Is_Not_Self_Hidden in second traversal.
2025-06-09 Gary Dismukes <dismukes@adacore.com>
* exp_aggr.adb (Expand_Container_Aggregate): Use the Base_Type of the
subtype provided by the context as the subtype of the temporary object
initialized by the aggregate.
2025-06-09 Eric Botcazou <ebotcazou@adacore.com>
* par-ch4.adb (P_Function_Name): Delete body.
(P_Qualified_Simple_Name_Resync): Do not raise Error_Resync on an
operator symbol followed by something else than a dot.
* par-ch6.adb (P_Subprogram): Do not call P_Function_Name.
* par.adb (P_Function_Name): Delete declaration.
2025-06-09 Ronan Desplanques <desplanques@adacore.com>
* sem.adb (Analyze): Adapt to new Ekinds.
* sem_ch3.adb (Analyze_Component_Declaration): Set Ekind early.
(Is_Visible_Component, Record_Type_Definition): Adjust.
2025-06-09 Ronan Desplanques <desplanques@adacore.com>
* sem.adb (Analyze): Fix comment.
2025-06-09 Eric Botcazou <ebotcazou@adacore.com>
* par-ch4.adb (P_Name): Remove obsolete references in comments.
(P_Qualified_Simple_Name): Call P_Qualified_Simple_Name_Resync.
(P_Qualified_Simple_Name_Resync): Adjust a couple of comments.
2025-06-09 Gary Dismukes <dismukes@adacore.com>
* exp_util.adb (Call_To_Parent_Dispatching_Op_Must_Be_Mapped): Replace
test of Covers with test of Is_Controlling_Formal. Add handling for
'Result actuals. Remove Actual_Type and its uses.
2025-06-09 Piotr Trojanek <trojanek@adacore.com>
* sem_util.adb (Is_Name_Reference): Remove check for selector_name of a
selected_component; reuse existing code for indexed components and
slices.
(Statically_Names_Object): Remove dead code.
2025-06-09 Eric Botcazou <ebotcazou@adacore.com>
* einfo.ads (Overlays_Constant): Define in constants and variables.
* gen_il-gen-gen_entities.adb (Entity_Kind): Move Overlays_Constant
semantic flag to...
(Constant_Or_Variable_Kind): ...here.
* sem_util.adb (Note_Possible_Modification): Add guard.
2025-06-09 Bob Duff <duff@adacore.com>
* exp_ch6.adb: (Make_Build_In_Place_Call_In_Object_Declaration):
Deal with renamings transformed into object declarations.
* sem_ch8.adb (Analyze_Object_Renaming):
Reinstate transformation of a renaming into
an object declaration.
2025-06-09 Ronan Desplanques <desplanques@adacore.com>
* sem_ch3.adb (Analyze_Object_Declaration): Call Mutate_Ekind earlier.
2025-06-09 Ronan Desplanques <desplanques@adacore.com>
* sem_ch3.adb (Analyze_Object_Declaration): Tweak error handling.
2025-06-09 Piotr Trojanek <trojanek@adacore.com>
* par-ch13.adb (Get_Aspect_Specifications): Save and restore flag while
parsing aspect Abstract_State.
* par-ch2.adb (P_Pragma): Same while parsing pragma Abstract_State.
* par-ch4.adb (P_Aggregate_Or_Paren_Expr): Specialize error message
for contract Abstract_State and extended aggregate.
* par.adb (Inside_Abstract_State): Add new context flag.
2025-06-09 Ronan Desplanques <desplanques@adacore.com>
* sem_ch10.adb (Analyze_Compilation_Unit): Check for generic bodies.
* exp_disp.adb (Build_Dispatch_Tables): Likewise.
2025-06-09 Piotr Trojanek <trojanek@adacore.com>
* sem_util.adb (Find_Overlaid_Entity): Don't call Etype on empty Ent;
tune style; move computation of Overl_Typ out of the loop.
2025-06-09 Javier Miranda <miranda@adacore.com>
* doc/gnat_rm/implementation_defined_pragmas.rst: Adding
documentation.
* doc/gnat_ugn/the_gnat_compilation_model.rst: ditto.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2025-06-09 Ronan Desplanques <desplanques@adacore.com>
* sem_attr.adb (Analyze_Attribute): Remove test.
2025-06-09 Ronan Desplanques <desplanques@adacore.com>
* sem_util.adb (Enter_Name): Remove special handling.
2025-06-09 Ronan Desplanques <desplanques@adacore.com>
* sem_util.adb (Enter_Name): Remove comment.
2025-06-09 Bob Duff <duff@adacore.com>
* exp_ch6.adb: Remove a couple of "???" suggesting something that
we will likely never do.
(Make_Build_In_Place_Call_In_Object_Declaration):
When a constraint check is needed, do the check.
Do it at the call site for now.
The check is still missing in the untagged case,
because the caller allocates in that case.
* sem_ch8.adb (Analyze_Object_Renaming):
Remove obsolete transformation of a renaming into
an object declaration. Given that we also (sometimes) tranform
object declarations into renamings, this transformation was
adding complexity; the new code in
Make_Build_In_Place_Call_In_Object_Declaration above
would need to explicitly avoid the run-time check in the case of
renamings, because renamings are supposed to ignore the nominal
subtype. Anyway, it is no longer needed.
* exp_ch3.adb (Expand_N_Object_Declaration): Rewrite comment;
it IS clear how to do it, but we haven't done it right yet.
2025-06-09 Ronan Desplanques <desplanques@adacore.com>
* atree.ads (Copy_Node): Fix comment.
2025-06-09 Piotr Trojanek <trojanek@adacore.com>
* exp_attr.adb (Expand_N_Attribute_Reference): When expanding attribute
Valid, use signedness from the validated view, not from its base type.
2025-06-09 Marc Poulhiès <poulhies@adacore.com>
* sem_util.adb (Find_Overlaid_Entity): Add extra parameter to
extract the type being overlaid.
(Note_Possible_Modification): Adjust call to Find_Overlaid_Entity.
(Ultimate_Overlaid_Entity): Likewise.
* sem_ch13.adb (Analyze_Attribute_Definition_Clause): Likewise.
* sem_util.ads (Find_Overlaid_Entity): Add extra parameter to
extract the type being overlaid.
* freeze.adb (Check_Address_Clause): Likewise.
2025-06-09 Gary Dismukes <dismukes@adacore.com>
* contracts.adb (Inherit_Condition): Remove Assoc_List and its uses
along with function Check_Condition, since mapping of formals will
effectively be done in Build_Class_Wide_Expression (by Replace_Entity).
* exp_util.adb (Replace_Entity): Only rewrite entity references in
function calls that qualify according to the result of calling the
new function Call_To_Parent_Dispatching_Op_Must_Be_Mapped.
(Call_To_Parent_Dispatching_Op_Must_Be_Mapped): New function that
determines whether a function call to a primitive of Par_Subp
associated tagged type needs to be mapped (according to whether
it has any actuals that reference controlling formals of the
primitive).
2025-06-09 Ronan Desplanques <desplanques@adacore.com>
* sem_ch3.adb (Analyze_Object_Declaration): Remove comment.
2025-06-09 Ronan Desplanques <desplanques@adacore.com>
* sem_util.ads (Current_Entity_In_Scope): Add example in comment.
2025-06-09 Ronan Desplanques <desplanques@adacore.com>
* atree.ads (Rewrite, Replace): Clarify comments.
2025-06-09 Ronan Desplanques <desplanques@adacore.com>
* atree.ads (Rewrite): Remove comment.
2025-06-09 Ronan Desplanques <desplanques@adacore.com>
* atree.adb (Rewrite): Improve readability.
2025-06-09 Ronan Desplanques <desplanques@adacore.com>
* sem_util.adb (Kill_Current_Values): Tweak condition.
2025-06-09 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch4.adb (Insert_Conditional_Object_Declaration): Remove Decl
formal parameter, add Typ and Const formal parameters.
(Expand_N_Case_Expression): Fix pasto in comment. Adjust call to
Insert_Conditional_Object_Declaration and tidy up surrounding code.
(Expand_N_If_Expression): Adjust couple of calls to
Insert_Conditional_Object_Declaration.
2025-06-09 Ronan Desplanques <desplanques@adacore.com>
* sem_ch8.adb (Find_Selected_Component): Fix error path.
2025-06-09 Eric Botcazou <ebotcazou@adacore.com>
* libgnat/s-dourea.adb (Is_Infinity): Rename to...
(Is_Infinity_Or_NaN): ...this.
("*"): Adjust accordingly.
("/"): Likewise.
(Sqr): Likewise.
* libgnat/s-dorepr.adb (Two_Prod): Likewise.
(Two_Sqr): Likewise.
* libgnat/s-dorepr__fma.adb (Two_Prod): Likewise.
2025-06-09 Daniel King <dmking@adacore.com>
* libgnat/i-cheri.ads
(Set_Bounds, Set_Exact_Bounds): Remove wrong intrinsic binding.
* libgnat/i-cheri.adb
(Set_Bounds, Set_Exact_Bounds): New subprogram bodies.
2025-06-09 Ronan Desplanques <desplanques@adacore.com>
* sem_ch8.adb (Find_Selected_Component): Add mention.
2025-06-06 Piotr Trojanek <trojanek@adacore.com>
* urealp.adb (UR_Negate): Capture array element in a local constant.
2025-06-06 Piotr Trojanek <trojanek@adacore.com>
* urealp.adb (UR_Exponentiate): Use local variable.
2025-06-06 Piotr Trojanek <trojanek@adacore.com>
* sem_ch13.adb (Analyze_Attribute_Definition_Clause): Tune code for
attribute Small.
* sem_prag.adb (Analyze_Attribute): Tune code for pragma Time_Slice.
2025-06-06 Piotr Trojanek <trojanek@adacore.com>
* ada_get_targ.adb, cstand.ads, cstand.adb, sem_eval.adb, sem_eval.ads,
urealp.adb, urealp.ads: Tune style.
2025-06-06 Piotr Trojanek <trojanek@adacore.com>
* get_targ.ads (Register_Proc_Type): Add null exclusion.
2025-06-06 Piotr Trojanek <trojanek@adacore.com>
* cstand.adb (Build_Float_Type, Register_Float_Type): Refine
parameter subtypes.
* set_targ.ads (FPT_Mode_Entry): Refine component subtype.
2025-06-06 Piotr Trojanek <trojanek@adacore.com>
* sem_prag.adb (Analyze_Pragma): Add dependency of Program_Exit on
Global and Depends contracts.
(Analyze_Program_Exit_In_Decl_Part): Check references to subprogram
outputs.
2025-06-06 Claire Dross <dross@adacore.com>
* doc/gnat_rm/implementation_defined_pragmas.rst
(Pragma Exit_Cases): Update the documentation for Exit_Cases.
* sem_prag.adb
(Anlayze_Pragma): Accept Program_Exit as an exit kind.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2025-06-06 Piotr Trojanek <trojanek@adacore.com>
* aspects.ads (Aspect_Argument): Argument for Program_Exit is now
optional.
* doc/gnat_rm/implementation_defined_pragmas.rst
(Pragma Program_Exit): Change documentation for pragma syntax.
* sem_prag.adb (Analyze_Pragma): Argument for Program_Exit is now
optional.
(Analyze_Program_Exit_In_Decl_Part): Likewise.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2025-06-06 Piotr Trojanek <trojanek@adacore.com>
* aspects.ads (Aspect_Id): Add new aspect identifier.
(Aspect_Argument): Specify argument for the new aspect.
(Is_Representation_Aspect): New aspect is not a representation aspect.
(Aspect_Names): Map new aspect to name.
(Aspect_Delay): New aspect is always delayed.
* contracts.adb (Expand_Subprogram_Contract)
(Add_Pre_Post_Condition, Add_Contract_Item)
(Analyze_Entry_Or_Subprogram_Contract)
(Analyze_Entry_Or_Subprogram_Body_Contract)
(Analyze_Subprogram_Body_Stub_Contract): Support new aspect.
* contracts.ads (Add_Contract_Item,
Analyze_Entry_Or_Subprogram_Contract,
Analyze_Entry_Or_Subprogram_Body_Contract,
Analyze_Subprogram_Body_Stub_Contract): Mention new contract in
comment.
* doc/gnat_rm/implementation_defined_aspects.rst
(Aspect Program_Exit): Document new aspect.
* doc/gnat_rm/implementation_defined_pragmas.rst
(Pragma Program_Exit): Document new pragma.
* einfo-utils.adb (Get_Pragma): Support new pragma.
* einfo-utils.ads (Get_Pragma): Mention new pragma in comment.
* exp_prag.adb (Expand_Pragma_Program_Exit): Expand new pragma;
body.
* exp_prag.ads (Expand_Pragma_Program_Exit): Expand new pragma;
spec.
* inline.adb (Remove_Aspects_And_Pragmas): Support new pragma.
* par-prag.adb (Prag): Support new pragma.
* sem_attr.adb (Analyze_Attribute_Old_Result): Accept attribute
Old in new pragma.
* sem_ch12.adb (Implementation of Generic Contracts): Mention new
aspect in comment.
* sem_ch13.adb (Insert_Pragma, Analyze_Aspect_Specifications):
Convert new new aspect to pragma.
* sem_ch6.adb (Analyze_Subprogram_Body_Helper): Renumber
subsequent rule in comment.
* sem_prag.adb (Check_Postcondition_Use_In_Inlined_Subprogram)
(Contract_Freeze_Error): Mention new pragma in comment.
(Analyze_Pragma): Support new pragma; renumber subsequent rule in
comment.
(Analyze_Program_Exit_In_Decl_Part): Analyze new pragma; body.
(Sig_Flags): References in new pragma are significant when
detecting unreferenced objects.
* sem_prag.ads (Aspect_Specifying_Pragma)
(Assertion_Expression_Pragma, Pragma_Significant_To_Subprograms):
Support new aspect and pragma.
(Analyze_Program_Exit_In_Decl_Part): Analyze new pragma; spec.
(Find_Related_Package_Or_Body): Mention new pragma in comment.
* sem_util.adb (Is_Subprogram_Contract_Annotation): Support new
pragma.
* sem_util.ads (Is_Subprogram_Contract_Annotation): Mention new
pragma in comment.
* sinfo.ads (Is_Generic_Contract_Pragma): Mention new pragma in
comment.
* snames.ads-tmpl (Preset Names, Pragma_Id): Add name and pragma
identifiers.
* gnat_rm.texi: Regenerate.
2025-06-06 Piotr Trojanek <trojanek@adacore.com>
* libgnat/g-dyntab.ads (Instance): Update and extend comment.
* scos.ads: Remove comment about the corresponding C header.
* scos.h: Remove.
2025-06-06 Steve Baird <baird@adacore.com>
* sem_util.adb (Collect_Primitive_Operations): When collecting
primitive operations, do not include child unit subprograms.
2025-06-06 Javier Miranda <miranda@adacore.com>
* sem_ch4.adb (Constant_Indexing_OK): Add missing support for
RM 4.1.6(13/3), and improve performance to avoid climbing more
than needed. Add documentation.
(Try_Indexing_Function): New subprogram.
(Expr_Matches_In_Formal): Added new formals.
(Handle_Selected_Component): New subprogram.
(Has_IN_Mode): New subprogram.
(Try_Container_Indexing): Add documentation, code reorganization
and extend its functionality to improve its support for prefixed
notation calls.
2025-06-06 Viljar Indus <indus@adacore.com>
* debug.adb: Mark -gnatd_D as unused.
* diagnostics-repository.adb: Move to...
* errid.adb: ...here.
* diagnostics-repository.ads: Move to...
* errid.ads: ...here.
* errout.adb (Error_Msg_Internal): Add new arguments for the new
attributes of Error_Msg_Objects.
(Error_Msg): Likewise.
(Error_Msg_N): Likewise.
(Labeled_Span): New method for creating Labeled_Span-s
(Primary_Label_Span): New method for creating primary Labeled_Spans.
(Secondary_Labeled_Span): New method for creating secondary
Labeled_Spans.
(Edit): New method for creating Edit elements.
(Fix): New method for creating Fix elements.
(Error_Msg_F): Simplify code for evaluating the span.
(Error_Msg_FE): Likewise.
(Error_Msg_NE): Likewise.
(Error_Msg_NEL): Likewise.
(Error_Msg_N_Gigi): New method that is used as a wrapper for the
Error_Msg_xxx methods that have the new arguments. This function
is later mapped to the Error_Msg method used inside gigi.
(Error_Msg_NE_Gigi): Likewise.
(Write_JSON_Span): Ensure that the Style prefix is included that is
removed when parsing the message is reinserted to the JSON report.
(Output_Messages): Use the new Pretty_Printer and Sarif_Printer
packages to print the messages and remove the old implementation
for the pretty printer.
(Set_Msg_Text): Remove message kind insertion characters from the
final message text to avoid some message kinds being duplicated.
(To_Full_Span_First): New method for creating a span for a node.
(To_Full_Span): Likewise.
* errout.ads: Add the specs for all of the newly added functions.
* diagnostics-pretty_emitter.adb: Move to...
* erroutc-pretty_emitter.adb: ...here.
* diagnostics-pretty_emitter.ads: Move to...
* erroutc-pretty_emitter.ads: ...here.
* diagnostics-sarif_emitter.adb: Move to...
* erroutc-sarif_emitter.adb: ...here.
* diagnostics-sarif_emitter.ads: Move to...
* erroutc-sarif_emitter.ads: ...here.
* erroutc.adb (Next_Error_Msg): New method for iterating to the
next error message.
(Next_Continuation_Msg): New method for iterating to the next
continuation message.
(Primary_Location): New method for returning the first primary
location for the error message.
(Get_Human_Id): New method for returning the human readable
name for the switch associated with this error message.
(Get_Doc_Switch): New method for creating the tag for the switch
used in the error message.
(Output_Text_Within): Change the method to operating on Strings
instead of String pointers.
(Output_Msg_Text): Simplify implementation for generating the
error message.
(Prescan_Message): Make the String handling more error proof.
* erroutc.ads (Error_Msg_Object): Add new attributes that were
added to Diagnostic objects to Error_Msg_Objects.
Add new methods for handling the new error objects.
* diagnostics-switch_repository.adb: Move to...
* errsw.adb: ...here.
* errutil.adb (Error_Msg): Initialize all of the new attributes
added to Error_Msg_Object-s.
* fe.h (Error_Msg_N): Update the binding.
(Error_Msg_NE): Update the binding.
For now the error_msg methods in gigi will use the old
simplified interface for those methods.
* diagnostics-json_utils.adb: Move to...
* json_utils.adb: ...here.
* diagnostics-json_utils.ads: Move to...
* json_utils.ads: ...here.
* par-endh.adb: Replace the old error_msg
calls with the updated interface.
* sem_aggr.adb: Likewise.
* sem_ch13.adb: Likewise.
* sem_ch4.adb: Likewise.
* sem_ch9.adb: Likewise.
* diagnostics-brief_emitter.adb: Removed.
* diagnostics-brief_emitter.ads: Removed.
* diagnostics-constructors.adb: Removed.
* diagnostics-constructors.ads: Removed.
* diagnostics-converter.adb: Removed.
* diagnostics-converter.ads: Removed.
* diagnostics-switch_repository.ads: Removed.
* diagnostics-utils.adb: Removed.
* diagnostics-utils.ads: Removed.
* diagnostics.adb: Removed.
* diagnostics.ads: Removed.
* errsw.ads: New file. Based on diagnostics-switch_repository.ads.
It additionally contains all the switch enumerations.
* gcc-interface/Make-lang.in: Update compilation dependencies.
* gcc-interface/Makefile.in: Likewise.
2025-06-06 Ronan Desplanques <desplanques@adacore.com>
* contracts.adb (Add_Invariant_And_Predicate_Checks): Assign Ekind.
* inline.adb (Expand_Inlined_Call): Likewise.
* exp_ch9.adb (Build_Simple_Entry_Call): Likewise.
* exp_dist.adb (Append_Array_Traversal): Likewise.
* exp_fixd.adb (Build_Double_Divide_Code, Build_Scaled_Divide_Code):
Likewise.
2025-06-06 Olivier Hainque <hainque@adacore.com>
* libgnarl/s-linux__android-aarch64.ads: Provide an
Android_Sigaction generic package to expose an aarch64
version of struct_sigation, using a provided sigset_t
for sa_flags.
* libgnarl/s-linux__android-arm.ads: Likewise, for ARM
rather than aarch64.
* libgnarl/s-osinte__android.ads: Move sigset_t definition
to the visible part and use it to instantiate the Android_Sigation
generic provided by System.Linux, which is specialized for ARM vs
aarch64. Define struct_sigaction out of the Android_Sigaction
instance, remove the local representation clauses.
2025-06-06 Olivier Hainque <hainque@adacore.com>
* Makefile.rtl: Rework the Android pairs to match those of a
regular Linux port rather than a generic posix one.
* libgnarl/s-osinte__android.ads: Import pcrtl and add bindings
for the pthread_rwlock entry points, used by the Linux units now
in the libgnat target pairs.
* sysdep.c (__gnat_has_cap_sys_nice): Define for Android,
conservative return 0.
* adaint.c (__gnat_cpu_alloc): Define for Android as for Linux.
2025-06-06 Piotr Trojanek <trojanek@adacore.com>
* namet.ads (Name_Entry): Update comments to explain the current needs.
2025-06-06 Piotr Trojanek <trojanek@adacore.com>
* lib.ads (Unit_Record): Remove representation clauses and filler
components
* lib-load.adb, lib-writ.adb: Remove initialization of data fillers.
* nlists.adb (Allocate_List_Tables): Remove explicit initialization.
* repinfo.adb (Exp_Node): Remove representation clauses.
* sinput.ads (Source_File_Record): Likewise.
* urealp.adb (Ureal_Entry): Likewise.
2025-06-06 Piotr Trojanek <trojanek@adacore.com>
* doc/gnat_rm/representation_clauses_and_pragmas.rst
(Effect of Convention on Representation): Fix number of list items.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2025-06-06 Eric Botcazou <ebotcazou@adacore.com>
* sem_ch10.adb (Install_Siblings.In_Context): Add missing guard.
2025-06-06 Ronan Desplanques <desplanques@adacore.com>
* sem_ch4.adb (Analyze_Selected_Component): Tweak condition.
2025-06-06 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch4.adb (Insert_Conditional_Object_Declaration): Make sure the
object is allocated properly by the code generator at library level.
2025-06-06 Piotr Trojanek <trojanek@adacore.com>
* sem_eval.adb (Check_Non_Static_Context): Remove special handling of
floating-point zero.
2025-06-06 Piotr Trojanek <trojanek@adacore.com>
* einfo.ads (Incomplete_View): Move from Sinfo; adapt wording.
* exp_ch3.adb (Build_Record_Init_Proc): Adapt retrieval of
Incomplete_View.
* gen_il-fields.ads (Opt_Field_Enum): Move Incomplete_View from node
to entity field.
* gen_il-gen-gen_entities.adb (Gen_Entities): Add field.
* gen_il-gen-gen_nodes.adb (Gen_Nodes): Remove field.
* sem_ch3.adb (Analyze_Full_Type_Declaration,
Check_Anonymous_Access_Component): Adapt setting of Incomplete_View.
* sem_ch6.adb (Analyze_Subprogram_Body_Helper): Adapt retrieval of
Incomplete_View for class-wide types; no longer rely on class-wide
type being attached to non-classwide type declaration.
* sem_util.adb (Collect_Primitive_Operations): Adapt retrieval of
Incomplete_View.
* sinfo.ads (Incomplete_View): Move to Einfo.
2025-06-06 squirek <squirek@adacore.com>
* aspects.ads: Add support for constructors.
* exp_aggr.adb: Likewise.
* exp_attr.adb: Likewise.
* exp_ch3.adb: Likewise.
* exp_ch4.adb: Likewise.
* exp_util.adb: Likewise.
* gen_il-fields.ads: Likewise.
* gen_il-gen-gen_entities.adb: Likewise.
* gen_il-gen-gen_nodes.adb: Likewise.
* par-ch4.adb: Likewise.
* sem_aggr.adb: Likewise.
* sem_attr.adb, sem_attr.ads: Likewise.
* sem_ch13.adb: Likewise.
* sem_ch3.adb: Likewise.
* sem_ch5.adb: Likewise.
* sem_ch6.adb: Likewise.
* sem_res.adb: Likewise.
* sem_util.adb, sem_util.ads: Likewise.
* snames.ads-tmpl: Likewise.
2025-06-06 squirek <squirek@adacore.com>
* doc/gnat_rm/gnat_language_extensions.rst: Add documentation.
* gnat_rm.texi: Regenerate.
2025-06-06 Eric Botcazou <ebotcazou@adacore.com>
* einfo.ads (Modulus): Change to implementation base type only.
* gen_il-gen-gen_entities.adb (Modular_Integer_Kind): Change type
of Modulus field to Impl_Base_Type_Only.
2025-06-06 Eric Botcazou <ebotcazou@adacore.com>
* einfo.ads (Original_Access_Type): Restore.
* gen_il-fields.ads (Opt_Field_Enum): Restore Original_Access_Type.
* gen_il-gen-gen_entities.adb: Adjust accordingly.
* exp_ch9.adb (Expand_Access_Protected_Subprogram_Type): Restore the
call to Set_Original_Access_Type.
2025-06-06 Eric Botcazou <ebotcazou@adacore.com>
* einfo.ads (Default_Expr_Function): Delete.
(Dependent_Instances): Likewise.
(Handler_Records): Likewise.
(Needs_Activation_Record): Likewise.
(Original_Access_Type): Likewise.
(Register_Exception_Call): Likewise.
* sinfo.ads (Accept_Handler_Records): Likewise.
* gen_il-fields.ads (Opt_Field_Enum): Remove Accept_Handler_Records,
Default_Expr_Function, Dependent_Instances, Handler_Records,
Needs_Activation_Record, Original_Access_Type and
Register_Exception_Call.
* gen_il-gen-gen_entities.adb: Adjust accordingly.
* gen_il-gen-gen_nodes.adb: Likewise.
* exp_ch9.adb (Expand_Access_Protected_Subprogram_Type): Remove call
to Set_Original_Access_Type.
(Expand_N_Selective_Accept): Remove call to Set_Handler_Records.
* exp_ch11.adb (Expand_N_Exception_Declaration): Remove call to
Set_Register_Exception_Call.
* sem_ch3.adb (Access_Subprogram_Declaration): Remove call to
Set_Needs_Activation_Record.
* sem_ch12.adb (Instantiate_Package_Body): Remove call to
Set_Handler_Records.
2025-06-06 Steve Baird <baird@adacore.com>
* sem_ch4.adb
(Find_Unary_Types): Because we reanalyze names in an instance,
we sometimes have to take steps to filter out extraneous name
resolution candidates that happen to be visible at the point of the
instance declaration. Remove some code that appears to have been
written with this in mind. This is done for two reasons. First, the
code sometimes doesn't work (possibly because the In_Instance test
is not specific enough - it probably should be testing to see whether
we are in an instance of the particular generic in which the result
of calling Corresponding_Generic_Type was declared) and causes correct
code to be rejected. Second, the code seems to no longer be necessary
(possibly because of subsequent fixes in this area which are not
specific to unary operators).
2025-06-06 Ronan Desplanques <desplanques@adacore.com>
* sem_ch8.adb (Premature_Usage): Remove dead code.
2025-06-06 Eric Botcazou <ebotcazou@adacore.com>
* einfo.ads (Size_Check_Code): Delete.
* gen_il-fields.ads (Opt_Field_Enum): Remove Size_Check_Code.
* gen_il-gen-gen_entities.adb (Constant_Or_Variable_Kind): Likewise.
* sem_ch13.adb (Analyze_Attribute_Definition_Clause): Remove call
to Kill_Size_Check_Code.
* sem_prag.adb (Analyze_Pragma): Likewise.
* sem_util.ads (Kill_Size_Check_Code): Delete.
* sem_util.adb (Kill_Size_Check_Code): Likewise.
2025-06-06 Claire Dross <dross@adacore.com>
* sem_ch6.adb (Analyze_SPARK_Subprogram_Specification):
Allow the first parameter of functions whose return type is
an anonymous access-to-variable type to have mode IN OUT.
2025-06-06 Ronan Desplanques <desplanques@adacore.com>
* gen_il-fields.ads: New field.
* gen_il-gen-gen_entities.adb: New field.
* einfo.ads: Document new field.
* sem_res.adb (Check_Discriminant_Use): Record relevant uses in new
field. Move warning emission to...
* sem_ch3.adb (Analyze_Full_Type_Declaration): ... Here.
2025-06-06 Steve Baird <baird@adacore.com>
* sem_disp.adb
(Check_Dispatching_Operation): Delete code to generate
"missing overriding indicator" warning. Update comments.
2025-06-06 Ronan Desplanques <desplanques@adacore.com>
* cstand.adb (Create_Standard): Delay declaration generation for
Natural and Positive.
2025-06-06 Ronan Desplanques <desplanques@adacore.com>
* cstand.adb (Create_Standard): Remove useless calls.
2025-06-06 Eric Botcazou <ebotcazou@adacore.com>
* exp_aggr.adb (Expand_Record_Aggregate): Use the named form for the
second actual parameter in the call to Duplicate_Subexpr.
* exp_attr.adb (Expand_Size_Attribute): Likewise.
* exp_ch5.adb (Expand_Assign_Array): Likewise.
(Expand_Assign_Array_Bitfield): Likewise.
(Expand_Assign_Array_Bitfield_Fast): Likewise.
* exp_util.ads (Duplicate_Subexpr): Add New_Scope formal parameter.
(Duplicate_Subexpr_No_Checks): Likewise.
(Duplicate_Subexpr_Move_Checks): Likewise.
* exp_util.adb (Build_Allocate_Deallocate_Proc): Pass Proc_Id as the
actual for New_Scope in the calls to Duplicate_Subexpr_No_Checks.
(Duplicate_Subexpr): Add New_Scope formal parameter and forward it
in the call to New_Copy_Tree.
(Duplicate_Subexpr_No_Checks): Likewise.
(Duplicate_Subexpr_Move_Checks): Likewise.
2025-06-06 Piotr Trojanek <trojanek@adacore.com>
* checks.adb (Insert_Valid_Check): Set flag Assignment_OK in the object
declaration inserted for the validity checks.
2025-06-05 squirek <squirek@adacore.com>
* sem_warn.adb
(Warn_On_Useless_Assignment): Disable out value "overwritten" warning
when we are not warning on unread out parameters (e.g. "-gnatw.o").
2025-06-05 Tonu Naks <naks@adacore.com>
* libgnat/i-cstrin.adb: null pointer check in Update
2025-06-05 Arnaud Charlet <charlet@adacore.com>
* exp_util.adb, rtsfind.adb, rtsfind.ads, sem_prag.adb: Remove
references to RO_GH_Big_Integer and
Ada_Numerics_Big_Numbers_Big_Integers_Ghost.
* libgnat/a-strfix.adb, libgnat/a-strmap.adb,
libgnat/a-strsea.adb, libgnat/a-strsup.adb,
libgnat/i-c.ads, libgnat/i-c.adb, libgnat/s-aridou.adb,
libgnat/s-aridou.ads, libgnat/s-arit128.adb,
libgnat/s-arit128.ads, libgnat/s-arit32.adb,
libgnat/s-arit32.ads, libgnat/s-arit64.adb,
libgnat/s-arit64.ads, libgnat/s-casuti.adb,
libgnat/s-exnint.ads, libgnat/s-exnlli.ads,
libgnat/s-exnllli.ads, libgnat/s-expint.ads,
libgnat/s-explli.ads, libgnat/s-expllli.ads,
libgnat/s-explllu.ads, libgnat/s-expllu.ads,
libgnat/s-expmod.adb, libgnat/s-expmod.ads,
libgnat/s-exponn.adb, libgnat/s-exponn.ads,
libgnat/s-expont.adb, libgnat/s-expont.ads,
libgnat/s-exponu.adb, libgnat/s-exponu.ads,
libgnat/s-imaged.ads, libgnat/s-imaged.adb,
libgnat/s-expuns.ads, libgnat/s-imagef.ads,
libgnat/s-imagef.adb, libgnat/s-imagei.adb,
libgnat/s-imagei.ads, libgnat/s-imageu.adb,
libgnat/s-imageu.ads, libgnat/s-imgboo.adb,
libgnat/s-imde128.ads, libgnat/s-imde32.ads,
libgnat/s-imde64.ads, libgnat/s-imfi128.ads,
libgnat/s-imfi32.ads, libgnat/s-imfi64.ads,
libgnat/s-imgboo.ads, libgnat/s-imgint.ads,
libgnat/s-imglli.ads, libgnat/s-imgllli.ads,
libgnat/s-imglllu.ads, libgnat/s-imgllu.ads,
libgnat/s-imguns.ads, libgnat/s-valboo.adb,
libgnat/s-valboo.ads, libgnat/s-valint.ads,
libgnat/s-vallli.ads, libgnat/s-valllli.ads,
libgnat/s-vallllu.ads, libgnat/s-valllu.ads,
libgnat/s-valuns.ads, libgnat/s-valuti.adb,
libgnat/s-valuti.ads, libgnat/s-valuei.adb,
libgnat/s-valuei.ads, libgnat/s-valueu.ads,
libgnat/s-valueu.adb, libgnat/s-veboop.adb,
libgnat/s-veboop.ads, libgnat/s-widint.ads,
libgnat/s-widlli.ads, libgnat/s-widllli.ads,
libgnat/s-widlllu.ads, libgnat/s-widllu.ads,
libgnat/s-widthi.adb, libgnat/s-widthu.adb,
libgnat/s-widthu.ads, libgnat/s-widuns.ads: Remove ghost code
and SPARK annotations.
* libgnat/a-nbnbig.ads, libgnat/a-nbnbig.adb,
libgnat/s-spark.ads, libgnat/s-spcuop.adb,
libgnat/s-spcuop.ads, libgnat/s-vaispe.adb,
libgnat/s-vaispe.ads, libgnat/s-vauspe.adb,
libgnat/s-vauspe.ads, libgnat/s-vs_int.ads,
libgnat/s-vs_lli.ads, libgnat/s-vs_llu.ads,
libgnat/s-vs_uns.ads, libgnat/s-valspe.adb,
libgnat/s-valspe.ads, libgnat/s-vsllli.ads,
libgnat/s-vslllu.ads: Removed.
* Makefile.rtl: Update list of runtime units.
* gcc-interface/Make-lang.in: Remove object files.
2025-06-05 Ronan Desplanques <desplanques@adacore.com>
* fname-uf.adb: Fix documentation comment.
(Get_Default_File_Name): Fix indices of default patterns.
2025-06-05 Ronan Desplanques <desplanques@adacore.com>
* atree.ads (New_Copy, Relocate_Node): Tweak documentation comments.
2025-06-05 Andres Toom <toom@adacore.com>
* libgnat/a-nudira.ads: Activate SPARK mode and add missing
basic contracts. Mark the unit as always terminating.
* libgnat/a-nuflra.ads: Idem.
2025-06-05 Javier Miranda <miranda@adacore.com>
* exp_ch7.adb (Process_Object_Declaration): Avoid generating
duplicate names for master nodes.
2025-06-05 Ronan Desplanques <desplanques@adacore.com>
* opt.ads: Remove useless variable.
* sem_ch9.adb (Analyze_Abort_Statement, Analyze_Accept_Alternative,
Analyze_Accept_Statement, Analyze_Asynchronous_Select,
Analyze_Conditional_Entry_Call, Analyze_Delay_Alternative,
Analyze_Delay_Relative, Analyze_Delay_Until, Analyze_Entry_Body,
Analyze_Entry_Body_Formal_Part, Analyze_Entry_Call_Alternative,
Analyze_Entry_Declaration, Analyze_Entry_Index_Specification,
Analyze_Protected_Body, Analyze_Protected_Definition,
Analyze_Protected_Type_Declaration, Analyze_Requeue,
Analyze_Selective_Accept, Analyze_Single_Protected_Declaration,
Analyze_Single_Task_Declaration, Analyze_Task_Body,
Analyze_Task_Definition, Analyze_Task_Type_Declaration,
Analyze_Terminate_Alternative, Analyze_Timed_Entry_Call,
Analyze_Triggering_Alternative): Remove useless assignments.
2025-06-05 Steve Baird <baird@adacore.com>
* sem_util.adb
(Side_Effect_Free_Statements): Return False if the statement list
includes an explicit (i.e. Comes_From_Source) raise statement.
2025-06-05 Javier Miranda <miranda@adacore.com>
* sem_ch6.adb (Analyze_Expression_Function): Add missing check
on premature use of incomplete type.
2025-06-05 Aleksandra Pasek <pasek@adacore.com>
* libgnat/s-arit32.adb: Add Ghost aspect to Lo.
2025-06-05 Ronan Desplanques <desplanques@adacore.com>
* exp_ch4.adb (Tagged_Membership): Fix for protected types.
2025-06-05 Bob Duff <duff@adacore.com>
* sem_eval.adb (Fold_Shift): If the Amount parameter is greater
than the size in bits, use the size. For example, if we are
shifting an Unsigned_8 value, then Amount => 1_000_001 gives the
same result as Amount => 8. This change avoids computing the value
of 2**1_000_000, which takes too long and uses too much memory.
Note that the computation we're talking about is a compile-time
computation. Minor cleanup. DRY.
* sem_eval.ads (Fold_Str, Fold_Uint, Fold_Ureal): Fold the
comments into one comment, because DRY. Remove useless
verbiage.
2025-06-05 Ronan Desplanques <desplanques@adacore.com>
* exp_attr.adb (Interunit_Ref_OK): Tweak categorization of compilation
units.
2025-06-05 Aleksandra Pasek <pasek@adacore.com>
* libgnat/s-aridou.adb: Add missing Ghost aspect to
Lemma_Not_In_Range_Big2xx64.
2025-06-05 Ronan Desplanques <desplanques@adacore.com>
* libgnat/s-trasym__dwarf.adb (Init_Module): Add mitigation.
2025-06-05 Eric Botcazou <ebotcazou@adacore.com>
* exp_aggr.adb (Build_Two_Pass_Aggr_Code): New function containing
most of the code initially present in Two_Pass_Aggregate_Expansion.
(Two_Pass_Aggregate_Expansion): Remove redundant N parameter.
Implement built-in-place expansion for (static) object declarations
and allocators, using Build_Two_Pass_Aggr_Code for the main work.
(Expand_Array_Aggregate): Adjust Two_Pass_Aggregate_Expansion call.
Replace Etype (N) by Typ in a couple of places.
* exp_ch3.adb (Expand_Freeze_Array_Type): Remove special case for
two-pass array aggregates.
(Expand_N_Object_Declaration): Do not adjust the object when it is
initialized by a two-pass array aggregate.
* exp_ch4.adb (Expand_Allocator_Expression): Apply the processing
used for container aggregates to two-pass array aggregates.
* exp_ch6.adb (Validate_Subprogram_Calls): Skip calls present in
initialization expressions of N_Object_Declaration nodes that have
No_Initialization set.
* sem_ch3.adb (Analyze_Object_Declaration): Detect the cases of an
array originally initialized by an aggregate consistently.
2025-06-05 Johannes Kliemann <kliemann@adacore.com>
* libgnat/s-arit32.adb (Lemma_Not_In_Range_Big2xx32): Add missing
Ghost aspect.
2025-06-05 Ronan Desplanques <desplanques@adacore.com>
* generate_minimal_reproducer.adb (Generate_Minimal_Reproducer): Fix
handling of preprocessing dependencies.
2025-06-05 Viljar Indus <indus@adacore.com>
* doc/gnat_rm/implementation_defined_attributes.rst: Update the
documentation for Valid_Value.
* sem_attr.adb (Analyze_Attribute): Reject types where
the root type originates from Standard.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2025-06-05 Gary Dismukes <dismukes@adacore.com>
* exp_aggr.adb (Two_Pass_Aggregate_Expansion): Change call to Make_Assignment
for the indexed aggregate object to call Change_Make_OK_Assignment instead.
2025-06-05 Steve Baird <baird@adacore.com>
* sem_prag.adb
(Analyze_Constituent): In the specific case case of a defined-too-late
abstract state constituent, generate an additional error message.
2025-06-05 Viljar Indus <indus@adacore.com>
* diagnostics-sarif_emitter.adb (Print_Invocations): fix
commandLine and executionSuccessful nodes.
Fix typo in the name for startLine.
* osint.adb (Modified Get_Current_Dir) Fix generation of
the current directory.
(Relative_Path): Avoid relative paths starting with a
path separator.
* osint.ads: Update the documentation for Relative_Path.
2025-06-05 Ronan Desplanques <desplanques@adacore.com>
* libgnat/i-cstrin.adb (New_String): Fix size of allocation.
2025-06-05 squirek <squirek@adacore.com>
* sem_ch8.adb (Analyze_Package_Name): Add code to expand use
clauses such that they have an implicit with associated with them
when extensions are enabled.
* sem_ch10.ads (Analyze_With_Clause): New.
* sem_ch10.adb (Analyze_With_Clause): Add comes from source check
for warning.
(Expand_With_Clause): Moved to the spec.
* sem_util.adb, sem_util.ads
(Is_In_Context_Clause): Moved from sem_prag.
* sem_prag.adb (Analyze_Pragma): Update calls to
Is_In_Context_Clause.
(Is_In_Context_Clause): Moved to sem_util.
2025-06-05 Piotr Trojanek <trojanek@adacore.com>
* doc/gnat_ugn/platform_specific_information.rst
(Setting Stack Size from gnatlink): Improve documentation.
* gnat-style.texi: Regenerate.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
2025-06-05 squirek <squirek@adacore.com>
* accessibility.adb (Check_Return_Construct_Accessibility):
Disable check generation when we are only checking semantics.
* opt.ads: Add new flag for -gnatc mode
* switch-c.adb (Scan_Front_End_Switches): Set flag for -gnatc mode
2025-06-05 Viljar Indus <indus@adacore.com>
* sem_ch8.adb (Mark_Use_Type): Additionally mark the types
of the parameters and return values as used when analyzing an
operator.
2025-06-05 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch9.adb (Build_Dispatching_Requeue): Take 'Tag of the
concurrent object instead of doing an unchecked conversion.
* exp_pakd.adb (Expand_Packed_Address_Reference): Perform address
arithmetic using an operator of System.Storage_Elements.
2025-06-05 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch6.adb (Expand_Actuals): Remove obsolete comment.
(Make_Build_In_Place_Call_In_Anonymous_Context): Always use a proper
object declaration initialized with the function call in the cases
where a temporary is needed, with Assignment_OK set on it.
* sem_util.adb (Entity_Of): Deal with rewritten function call first.
2025-06-05 Ronan Desplanques <desplanques@adacore.com>
* libgnat/i-cstrin.adb (Position_Of_Nul): Change specification and
adjust body accordingly.
(New_Char_Array): Fix size of allocation.
(To_Chars_Ptr): Adapt to Position_Of_Nul change.
2025-06-05 Ronan Desplanques <desplanques@adacore.com>
* generate_minimal_reproducer.adb (Generate_Minimal_Reproducer): Fix
oracle generation.
2025-06-05 Ronan Desplanques <desplanques@adacore.com>
* generate_minimal_reproducer.adb (Generate_Minimal_Reproducer):
Fix when main library item is an instantiation.
2025-06-05 Steve Baird <baird@adacore.com>
* exp_attr.adb (Expand_N_Attribute_Reference): When accessing the
maps declared in package Cached_Attribute_Ops, the key value
passed to Get or to Set should never be the entity node for a
subtype. Use the entity of the corresponding type declaration
instead.
2025-06-05 Viljar Indus <indus@adacore.com>
* sem_res.adb (Resolve_Declare_Expression): Mark used
local variables inside a declare expression as referenced.
2025-06-05 Javier Miranda <miranda@adacore.com>
* sem.ads: Update reference to renamed subprogram in documentation.
* sem_ch3.ads (Preanalyze_Assert_Expression): Renamed.
(Preanalyze_Spec_Expression): Renamed.
* sem_ch3.adb (Preanalyze_Assert_Expression): Renamed and code cleanup.
(Preanalyze_Spec_Expression): Renamed.
(Preanalyze_Default_Expression): Renamed.
* contracts.adb: Update calls to renamed subprograms.
* exp_pakd.adb: Ditto.
* exp_util.adb: Ditto.
* freeze.adb: Ditto.
* sem_ch12.adb: Ditto.
* sem_ch13.adb: Ditto.
* sem_ch6.adb: Ditto.
* sem_prag.adb: Ditto.
* sem_res.adb (Preanalyze_And_Resolve): Add to the version without
context type the special handling for GNATprove mode provided by
the version with context type; required to cleanup the body of
Preanalyze_Assert_Expression.
2025-06-05 squirek <squirek@adacore.com>
* accessibility.adb
(Check_Return_Construct_Accessibility): Disable check generation
when we are only checking semantics.
2025-06-05 Viljar Indus <indus@adacore.com>
* diagnostics-json_utils.adb: Add new method To_File_Uri to
convert any path to the URI standard.
* diagnostics-json_utils.ads: Likewise.
* diagnostics-sarif_emitter.adb: Converted Artifact_Change
types to use the Source_File_Index instead of the file name
to store the source file.
Removed the body from Destroy (Elem : in out Artifact_Change)
since it no longer contained elements with dynamic memory.
Updated the implementation of Equals (L, R : Artifact_Change)
to take into account the changes for Artifact_Change.
Print_Artifact_Location: Use the Source_File_Index as an
input argument. Now prints the uriBaseId attribute and a
relative path from the uriBaseId to the file in question as
the value of the uri attribute.
New method Print_Original_Uri_Base_Ids to print the
originalUriBaseIds node.
Print_Run no prints the originalUriBaseIds node.
Use constants instead of strings for all the SARIF attributes.
* osint.adb: Add new method Relative_Path to calculate the
relative path from a base directory.
Add new method Root to calculate the root of each directory.
Add new method Get_Current_Dir to get the current working
directory for the execution environment.
* osint.ads: Likewise.
* clean.adb: Use full names for calls to Get_Current_Dir.
* gnatls.adb: Likewise.
2025-06-05 Steve Baird <baird@adacore.com>
* sem_res.adb
(Set_Mixed_Mode_Operand): If we are about to call Resolve
passing in Any_Fixed as the expected type, then instead pass in
the fixed point type of the other operand (i.e., B_Typ).
2025-06-05 Gary Dismukes <dismukes@adacore.com>
* sem_util.adb (Check_Function_Writable_Actuals): Add handling for
N_Iterated_Component_Association and N_Iterated_Element_Association.
Fix a typo in an RM reference (6.4.1(20/3) => 6.4.1(6.20/3)).
(Collect_Expression_Ids): New procedure factoring code for collecting
identifiers from expressions of aggregate associations.
(Handle_Association_Choices): New procedure factoring code for handling
id collection for expressions of aggregate associations with multiple
choices. Removed redundant test of Box_Present from original code.
2025-05-24 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/Make-lang.in (ACATSDIR): Use acats-2 directory.
2025-05-13 Nicolas Boulenguez <nicolas@debian.org>
PR ada/87778
* Make-generated.in: Remove -q gnatmake option.
* gcc-interface/Makefile.in: Likewise.
2025-05-05 Eric Botcazou <ebotcazou@adacore.com>
PR ada/120104
* exp_ch3.adb (Expand_Freeze_Record_Type): For a controlled tagged
type, freeze only the controlled primitives that are present.
2025-04-30 Eric Botcazou <ebotcazou@adacore.com>
PR ada/112958
* Makefile.rtl (LIBGNAT_TARGET_PAIRS) [x86 FreeBSD]: Add specific
version of s-dorepr.adb.
* libgnat/s-dorepr__freebsd.adb: New file.
2025-04-30 Eric Botcazou <ebotcazou@adacore.com>
PR ada/112958
* init.c (__gnat_error_handler) [__FreeBSD__]: Fix typo.
2025-04-27 H.J. Lu <hjl.tools@gmail.com>
PR middle-end/112877
* gcc-interface/utils.cc (create_param_decl): Remove the
targetm.calls.promote_prototypes call.
2025-04-17 Jakub Jelinek <jakub@redhat.com>
* gnatvsn.ads: Bump Library_Version to 16.
2025-04-12 Eric Botcazou <ebotcazou@adacore.com>
PR ada/119643
* sem_ch8.adb (Inherit_Renamed_Profile): Add guard against the
peculiarities of Natural and Positive.
2025-04-07 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/utils.cc (convert) <POINTER_TYPE>: Use fold_convert
to convert between thin pointers. If the source is a thin pointer
with zero offset from the base and the target is a pointer to its
array, displace the pointer after converting it.
* gcc-interface/utils2.cc (build_unary_op) <ATTR_ADDR_EXPR>: Use
fold_convert to convert the address before displacing it.
2025-04-04 Eric Botcazou <ebotcazou@adacore.com>
* libgnat/a-ngcoar.adb (Eigensystem): Adjust notation and fix the
layout of the real symmetric matrix in the main comment. Adjust
the layout of the associated code accordingly and correctly turn
the 2Nx1 real vectors into Nx1 complex ones.
(Eigenvalues): Minor similar tweaks.
* libgnat/a-ngrear.adb (Jacobi): Minor tweaks in the main comment.
Adjust notation and corresponding parameter names of functions.
Fix call to Unit_Matrix routine. Adjust the comment describing
the various kinds of iterations to match the implementation.
2025-03-27 Eric Botcazou <ebotcazou@adacore.com>
* libgnarl/s-tasini.adb (Tasking_Runtime_Initialize): Add pragma
Linker_Constructor for the procedure.
2025-03-25 Eric Botcazou <ebotcazou@adacore.com>
PR ada/119440
* gcc-interface/Make-lang.in (GCC_LINK): Filter out -pie in stage 1
(GCC_LLINK): Likewise.
* gcc-interface/Makefile.in (COMPILER): Delete and replace by CC.
(COMPILER_FLAGS): Delete.
(ALL_COMPILERFLAGS): Delete and replace by ALL_CFLAGS.
(ALL_ADAFLAGS): Move around.
(enable_host_pie): New substituted variable.
(LD_PICFLAG): Likewise. Do not add it to TOOLS_LIBS.
(LIBIBERTY): Test enable_host_pie.
(LIBGNAT): Likewise and use libgnat_pic.a if yes.
(TOOLS_FLAGS_TO_PASS): Pass $(PICFLAG) under CFLAGS & $(LD_PICFLAG)
under LDFLAGS. Also pass through ADA_CFLAGS.
(common-tools): Add $(ALL_CFLAGS) $(ADA_CFLAGS) to the --GCC string
of $(GNATLINK) commands.
(../../gnatdll$(exeext)): Likewise.
(gnatmake-re): Likewise.
(gnatlink-re): Likewise.
(gnatlib-shared-dual): Remove all the object files at the end.
2025-03-19 Eric Botcazou <ebotcazou@adacore.com>
* gnatvsn.adb (Gnat_Free_Software): Fix message formatting.
2025-03-19 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Record_Subtype>: Set
the may_alias attribute if a specific GCC type is built.
2025-03-19 Eric Botcazou <ebotcazou@adacore.com>
* gen_il-gen-gen_nodes.adb (N_Formal_Package_Declaration): Use
N_Declaration instead of Node_Kind as ancestor.
* sem_ch12.adb (Get_Formal_Entity): Remove obsolete alternative.
(Instantiate_Formal_Package): Take into account the abbreviated
instances in the main loop running over the actuals of the local
package created for the formal package.
2025-02-04 Eric Botcazou <ebotcazou@adacore.com>
PR ada/118731
* sem_aggr.adb (Resolve_Iterated_Association): Add missing guard.
2025-02-01 Eric Botcazou <ebotcazou@adacore.com>
PR ada/118712
* sem_warn.adb (Check_References): Deal with small adjustments of
references.
2025-01-31 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/utils.cc (gnat_pushdecl): Clear TREE_PUBLIC on
functions really nested in another function.
2025-01-22 Arsen Arsenović <arsen@aarsen.me>
* gcc-interface/lang-specs.h: Replace %{nostdinc*} %{nostdlib*}
with %{nostdinc} %{nostdlib}.
2025-01-14 Eric Botcazou <ebotcazou@adacore.com>
PR ada/118459
* libgnat/s-objrea.ads (Object_Arch): Add S390 and RISCV.
* libgnat/s-objrea.adb (EM_S390): New named number.
(EM_RISCV): Likewise.
(ELF_Ops.Initialize): Deal with EM_S390 and EM_RISCV.
(Read_Address): Deal with S390 and RISCV.
2025-01-13 Pascal Obry <obry@adacore.com>
* doc/gnat_ugn/platform_specific_information.rst: Update.
* gnat_ugn.texi: Regenerate.
2025-01-13 Javier Miranda <miranda@adacore.com>
* sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Restore calls
to Preanalyze_Spec_Expression that were replaced by calls to
Preanalyze_And_Resolve. Add documentation.
(Check_Aspect_At_Freeze_Point): Ditto.
2025-01-13 Pascal Obry <obry@adacore.com>
* mdll.adb: For the created DLL to be relocatable we do not want to use
the base file name when calling gnatdll.
* gnatdll.adb: Removes option -d which is not working anymore. And
when using a truly relocatable DLL the base-address has no real
meaning. Also reword the usage string for -d as we do not want to
specify relocatable as gnatdll can be used to create both
relocatable and non relocatable DLL.
2025-01-13 Piotr Trojanek <trojanek@adacore.com>
* libgnat/a-strunb.ads: Remove redundant parentheses inside NOT
operators.
2025-01-13 Javier Miranda <miranda@adacore.com>
* sem_util.adb (Build_Actual_Subtype_Of_Component): No action
under preanalysis.
* sem_ch5.adb (Set_Assignment_Type): If the right-hand side contains
target names, expansion has been disabled to prevent expansion that
might move target names out of the context of the assignment statement.
Restore temporarily the current compilation mode so that the actual
subtype can be built.
2025-01-13 Piotr Trojanek <trojanek@adacore.com>
* par-ch4.adb (P_Factor): Warn when the operand of a unary operator
doesn't require parentheses.
2025-01-13 Piotr Trojanek <trojanek@adacore.com>
* libgnat/s-genbig.adb: Remove redundant parentheses in comments.
2025-01-13 Piotr Trojanek <trojanek@adacore.com>
* checks.adb, exp_dist.adb, exp_imgv.adb, exp_util.adb,
libgnarl/a-reatim.adb, libgnat/a-coinve.adb, libgnat/a-nbnbre.adb,
libgnat/a-ngcoty.adb, libgnat/a-ngelfu.adb, libgnat/a-ngrear.adb,
libgnat/a-strbou.ads, libgnat/a-strfix.ads, libgnat/a-strsea.adb,
libgnat/a-strsea.ads, libgnat/a-strsup.ads,
libgnat/a-strunb__shared.ads, libgnat/g-alleve.adb,
libgnat/g-spitbo.adb, libgnat/s-aridou.adb, libgnat/s-arit32.adb,
libgnat/s-dourea.ads, libgnat/s-genbig.adb, libgnat/s-imager.adb,
libgnat/s-statxd.adb, libgnat/s-widthi.adb, sem_attr.adb, sem_ch10.adb,
sem_ch3.adb, sem_ch6.adb, sem_ch7.adb, sem_dim.adb, sem_prag.adb,
sem_res.adb, uintp.adb: Remove redundant parentheses inside NOT and ABS
operators.
2025-01-13 Piotr Trojanek <trojanek@adacore.com>
* par-ch3.adb (P_Discrete_Range): Detect redundant parentheses in the
lower bound like in the upper bound.
2025-01-13 Gary Dismukes <dismukes@adacore.com>
* sem_aggr.adb (Resolve_Aggregate): Add another condition to prevent rewriting
an aggregate whose type is an array of characters, testing for the presence of
predicates on the component type.
2025-01-13 Piotr Trojanek <trojanek@adacore.com>
* exp_ch4.adb: (Expand_N_Not_In): Preserve Alternatives in expanded
membership operator just like preserving Right_Opnd (though only
one of these fields is present at a time).
* par-ch4.adb (P_Membership_Test): Remove redundant setting of fields
to their default values.
2025-01-13 Piotr Trojanek <trojanek@adacore.com>
* par-ch3.adb (P_Discrete_Range): Replace N_Subexpr, which was catching
all subexpressions, with kinds that catch nodes that require
parentheses to become "simple expressions".
2025-01-13 Eric Botcazou <ebotcazou@adacore.com>
* libgnat/s-valrea.adb (Large_Powfive) [2 parameters]: Add a couple
of additional comments.
2025-01-13 Piotr Trojanek <trojanek@adacore.com>
* par-ch4.adb (P_Relation): Prevent Expr_Form to be overwritten when
parsing the raise expression itself.
(P_Simple_Expression): Fix manipulation of Expr_Form.
2025-01-10 squirek <squirek@adacore.com>
* accessibility.adb:
(Innermost_master_Scope_Depth): Add special case for expressions
within library level subprograms.
2025-01-10 Marc Poulhiès <poulhies@adacore.com>
* env.h: Remove last empty line.
2025-01-10 Piotr Trojanek <trojanek@adacore.com>
* contracts.adb (Build_Call_Helper_Decl): Tune whitespace.
* exp_attr.adb (Analyze_Attribute): Set Of_Present while
creating the node; reorder setting Subtype_Indication to match the
syntax order.
* exp_ch3.adb (Build_Equivalent_Aggregate): Likewise for Box_Present
and Expression properties.
* sem_ch12.adb (Analyze_Formal_Derived_Type): Set type properties
when creating the nodes.
* sem_ch3.adb (Check_Anonymous_Access_Component): Likewise.
2025-01-10 Piotr Trojanek <trojanek@adacore.com>
* gen_il-gen-gen_nodes.adb (Gen_Nodes): Change Is_Effective_Use_Clause
from syntactic to semantic property.
2025-01-10 Piotr Trojanek <trojanek@adacore.com>
* exp_ch3.adb (Predef_Spec_Or_Body): Add explicit parameter
associations, because now the Empty_List actual parameter would be
confused as being for the Aspect_Specifications formal parameter.
* gen_il-gen-gen_nodes.adb (Gen_Nodes): Reorder syntactic fields.
* sem_util.adb (Declare_Indirect_Temp): Add explicit parameter
association, because now the parameter will be interpreted as a
subpool handle name.
2025-01-09 Eric Botcazou <ebotcazou@adacore.com>
PR ada/18765
* debug.adb (d_q): Document new usage.
* sem_ch6.adb (New_Overloaded_Entity): Apply the special processing
to all equality operators whose base result type is Boolean, but do
not enforce the new Ada 2012 freezing rule if the result type is a
proper subtype of it and the -gnatd_q switch is specified.
2025-01-09 Eric Botcazou <ebotcazou@adacore.com>
PR ada/118274
* sem_ch4.adb (Check_Arithmetic_Pair.Has_Fixed_Op): Use the original
node of the operator to identify the case of an expanded name whose
prefix is the package Standard.
2025-01-09 squirek <squirek@adacore.com>
* libgnat/a-comutr.adb, libgnat/a-comutr.ads:
Move the declarations of iterator types into the specification and
add additional comments.
2025-01-09 Javier Miranda <miranda@adacore.com>
* freeze.adb (Freeze_Expr_Types): Reverse patch; that is, restore
calls to Preanalyze_Spec_Expression instead of Preanalyze_And_Resolve
for the sake of consistency with Analyze_Expression_Function. Patch
suggested by Eric Botcazou.
* exp_put_image.adb (Image_Should_Call_Put_Image): Ensure that
function Defining_Identifier is called with a proper node to
avoid internal assertion failure.
2025-01-07 Marc Poulhiès <poulhies@adacore.com>
* libgnat/a-calcon.ads: Adjust.
* libgnat/a-calend.ads: Adjust.
2025-01-07 Alexandre Oliva <oliva@adacore.com>
* gcc-interface/Make-lang.in (GNAT_ADA_OBJS, GNATBIND_OBJS):
Drop g-cpp, g-cppexc and g-cppstd.
2025-01-07 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.cc (Call_to_gnu): Always use the return slot
optimization if the parent node is an initialization statement.
(gnat_to_gnu) <N_Assignment_Statement>: Build an INIT_EXPR instead
of a MODIFY_EXPR if this is an initialization statement.
2025-01-07 Piotr Trojanek <trojanek@adacore.com>
* gen_il-fields.ads (Opt_Field_Enum): Remove flag.
* gen_il-gen-gen_nodes.adb (N_Attribute_Definition_Clause): Remove
field.
* sem_ch13.adb (Validate_Address_Clauses): Remove read of the flag.
* sinfo.ads (Address_Warning_Posted): Remove flag description.
2025-01-07 Eric Botcazou <ebotcazou@adacore.com>
* exp_aggr.adb (Packed_Array_Aggregate_Handled): Remove declaration
and handler for Not_Handled local exception. Check the return value
of Get_Component_Val instead.
(Get_Component_Val): Return No_Uint instead of raising Not_Handled.
2025-01-07 Javier Miranda <miranda@adacore.com>
* exp_util.adb (Insert_Actions): Document behavior under strict
preanalysis.
* sem.ads (In_Strict_Preanalysis): New subprogram.
(Preanalysis_Active): Replace 'and' operator by 'and then'.
* sem.adb (In_Strict_Preanalysis): Ditto.
* sem_attr.adb (Check_Dereference): Replace In_Spec_Expression
occurrence by call to Preanalysis_Active, and document it.
(Resolve_Attribute [Atribute_Access]): Ditto.
(Eval_Attribute): No evaluation under strict preanalysis.
(Validate_Static_Object_Name): No action under strict preanalysis.
* sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Replace
calls to Preanalyze_Spec_Expression by calls to Preanalyze_And_Resolve.
(Check_Aspect_At_Freeze_Point): Ditto.
(Resolve_Aspect_Expressions [Dynamic/Static/Predicate aspects]): Code
cleanup adjusting the code to emulate Preanalyze_And_Resolve, instead
of Preanalyze_Spec_Expression.
(Resolve_Aspect_Expressions [CPU/Interrupt_Priority/Priority/
Storage_Size aspects]): Replace calls to Preanalyze_Spec_Expression
by call to Preanalyze_And _Resolve.
* sem_ch3.adb (Analyze_Object_Declaration): Replace In_Spec_Expression
occurrence by call to Preanalysis_Active.
(Find_Type_Of_Object): Add documentation.
* sem_ch4.adb (Analyze_Case_Expression): Replace In_Spec_Expression
occurrence by call to Preanalysis_Active.
* sem_ch6.adb (Analyze_Expression_Function): Minor code reorganization
moving the code preanalyzing the expression after the new body has
been inserted in the tree to ensure that its Parent attribute is
available for preanalysis.
* sem_cat.adb (Validate_Static_Object_Name): No action under strict
preanalysis.
* sem_elab.adb (Check_For_Eliminated_Subprogram): Replace In_Spec_Expression
occurrence by call to Preanalysis_Active.
* sem_eval.adb (Eval_Intrinsic_Call [Name_Enclosing_Entity]): Ditto.
* sem_elim.adb (Check_For_Eliminated_Subprogram): Ditto.
* sem_res.adb (Resolve_Entity_Name): Ditto.
2025-01-07 Piotr Trojanek <trojanek@adacore.com>
* repinfo-input.adb (Decode_Name, Read_Name_With_Prefix): Use constant
overlay with pragma Import.
2025-01-07 Piotr Trojanek <trojanek@adacore.com>
* exp_disp.adb (Write_DT): Add guards that prevent crashes on illegal
node numbers.
2025-01-07 Piotr Trojanek <trojanek@adacore.com>
* diagnostics-pretty_emitter.adb (Get_Last_Line_Char): Fix whitespace.
* sem_aggr.adb (Resolve_Array_Aggregate): Fix style.
2025-01-07 Piotr Trojanek <trojanek@adacore.com>
* sem_util.adb (Is_Null_Record_Definition): Remove check for
Component_List being present after using it; replace check for
component item being a component declaration with an assertion;
fix style in comment.
2025-01-07 Ronan Desplanques <desplanques@adacore.com>
* exp_ch11.adb (Expand_N_Handled_Sequence_Of_Statements): Fix abort
deferral.
2025-01-07 Steve Baird <baird@adacore.com>
* gen_il-fields.ads: add new Renames_Limited_View field.
* gen_il-gen-gen_entities.adb: add Renames_Limited_View flag for
packages.
* einfo.ads: add comment documenting Renames_Limited_View flag.
* sem_ch8.adb (Analyze_Package_Renaming): Set new Renames_Limited_View
flag. Test new Renames_Limited_View flag instead of calling
Has_Limited_With. If Has_Limited_With is True, that just means
that somebody, sometime during this compilation needed to
reference the limited view of the package; so that function
returns True too often to be used here.
(Find_Expanded_Name): Test new Renames_Limited_View flag instead of
calling Has_Limited_With.
2025-01-07 Piotr Trojanek <trojanek@adacore.com>
* contracts.adb (Inherit_Pragma): Don't set flag Is_Inherited_Pragma.
* gen_il-fields.ads (Opt_Field_Enum): Remove field identifier.
* gen_il-gen-gen_nodes.adb (N_Pragma): Remove field from node.
* sinfo.ads (Is_Inherited_Pragma): Remove field description.
(N_Pragma): Remove field reference.
2025-01-07 Piotr Trojanek <trojanek@adacore.com>
* sem_prag.adb (Analyze_Attribute): Replace runtime conversion
with existing constant.
2025-01-07 Piotr Trojanek <trojanek@adacore.com>
* sem_attr.adb (Analyze_Attribute): Simplify logic.
2025-01-07 Piotr Trojanek <trojanek@adacore.com>
* exp_attr.adb (Expand_N_Attribute_Reference): Remove explicit
handling of attributes related to Ada 2012 iterators.
* sem_attr.adb (Analyze_Attribute, Eval_Attribute): Likewise;
move attribute Reduce according to alphabetic order.
* snames.adb-tmpl (Get_Attribute_Id): Add support for new internal
attributes.
* snames.ads-tmpl: Recognize names of new internal attributes.
(Attribute_Id): Recognize new internal attributes.
(Internal_Attribute_Id): Likewise.
(Is_Internal_Attribute_Name): Avoid duplication in comment.
2025-01-07 Piotr Trojanek <trojanek@adacore.com>
* accessibility.adb (First_Selector): Remove redundant and locally
inconsistent parenthesis.
(Check_Return_Construct_Accessibility): Remove qualifier from list
operation.
* sem_util.adb (Is_Prim_Of_Abst_Type_With_Nonstatic_CW_Pre_Post):
Likewise.
2025-01-07 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch7.ads (Store_After_Actions_In_Scope_Without_Analysis): New
procedure declaration.
* exp_ch7.adb (Store_New_Actions_In_Scope): New procedure.
(Store_Actions_In_Scope): Call Store_New_Actions_In_Scope when the
target list is empty.
(Store_After_Actions_In_Scope_Without_Analysis): New procedure body.
* exp_aggr.adb (Expand_Container_Aggregate): For a declaration that
is wrapped in a transient scope, also defer the analysis of the new
code until after the declaration is analyzed.
2025-01-07 Eric Botcazou <ebotcazou@adacore.com>
* libgnat/s-powflt.ads (Maxpow_Exact): Minor comment fix.
* libgnat/s-powlfl.ads (Maxpow_Exact): Likewise.
* libgnat/s-powllf.ads (Maxpow_Exact): Likewise.
* libgnat/s-valrea.adb (Large_Powfive) [1 parameter]: Exit the loop
as soon as the result saturates to +Inf.
(Large_Powfive) [2 parameters]: Likewise.
2025-01-07 Alexandre Oliva <oliva@adacore.com>
* libgnat/system-vxworks-ppc-rtp-smp.ads: Drop
--specs=vxworks-ppc-link.spec from Linker_Options.
* vxworks-smp-ppc-link.spec: Delete.
2025-01-07 Ronan Desplanques <desplanques@adacore.com>
* atree.adb (Parent_Or_List_Containing): New function.
* atree.ads (Parent_Or_List_Containing): Likewise.
* gen_il-fields.ads: Add new field.
* gen_il-gen-gen_nodes.adb (Gen_Nodes): Extend handled sequence of
statements node.
* par-ch11.adb (P_Handled_Sequence_Of_Statements, P_Exception_Handler):
Add new syntactic construct.
* par-ch5.adb (P_Sequence_Of_Statements): Likewise.
* par.adb: Likewise.
* par-util.adb (Check_Future_Keyword): Warn that "finally" becomes a
reserved word with extensions.
* scans.adb (Initialize_Ada_Keywords): Add new reserved word.
* snames.adb-tmpl: Likewise.
* snames.ads-tmpl: Likewise.
* scans.ads: Likewise.
* sem_ch11.adb (Analyze_Handled_Statements): Adapt to new node field.
* sem_ch5.adb (Analyze_Exit_Statement): Add legality check.
(Analyze_Goto_Statement): Likewise.
* sem_ch6.adb (Analyze_Return_Statement): Likewise.
* sinfo-utils.adb (Lowest_Common_Ancestor, Destroy_Element): New
subprograms.
* sinfo-utils.ads (Lowest_Common_Ancestor): New function.
* sinfo.ads: Add documentation for new field.
* xsnamest.adb: Fix typo in comment.
* doc/gnat_rm/gnat_language_extensions.rst: Document new extension.
* warnsw.adb: Add new option.
* warnsw.ads: Likewise.
* exp_ch11.adb (Expand_N_Handled_Sequence_Of_Statements): Add abort
deferral to finally part.
* gnat_rm.texi: Regenerate.
* gnat_ugn.texi: Regenerate.
* gcc-interface/trans.cc (Handled_Sequence_Of_Statements_to_gnu):
Handle finally statements.
2025-01-07 Eric Botcazou <ebotcazou@adacore.com>
* exp_aggr.adb (Expand_Array_Aggregate): Do not exclude aggregates
of bit-packed array types in assignments from in-place expansion.
2025-01-07 Piotr Trojanek <trojanek@adacore.com>
* sem_prag.adb (Analyze_Exceptional_Cases_In_Decl_Part): Reject
references to attribute Result.
2025-01-07 Piotr Trojanek <trojanek@adacore.com>
* sem_prag.adb (Analyze_Exceptional_Cases_In_Decl_Part): Move check
from GNATprove backend to GNAT frontend.
2025-01-07 Piotr Trojanek <trojanek@adacore.com>
* sem_prag.adb (Analyze_Exceptional_Contract, Analyze_Variant): Fix
comments.
2025-01-07 Steve Baird <baird@adacore.com>
* exp_put_image.adb (Image_Should_Call_Put_Image): Cope with the case
where the attribute prefix for an Image attribute reference
denotes an Itype constructed for a fixed point type. Calling
Has_Aspect with such an Itype misses applicable aspect
specifications; we need to look on the right list. This comes up
if the prefix of the attribute reference is
Some_Fixed_Point_Type'Base.
2025-01-07 Gary Dismukes <dismukes@adacore.com>
* sem_ch12.adb (Analyze_One_Association): In the case of a formal type
that has a Default_Subtype_Mark that does not have its Entity field set,
this means the default refers to another formal type of the same generic
formal part, so locate the matching subtype in the Result_Renamings and
set Match's Entity to that subtype prior to the call to Instantiate_Type.
(Validate_Formal_TypeDefault.Reference_Formal): Add test of Entity being
Present, to prevent blowups on End_Label ids (which don't have Entity set).
(Validate_Formal_Type_Default.Validate_Derived_Type_Default): Apply
Base_Type to Formal.
(Validate_Formal_Type_Default): Guard interface-related semantic checks
with a test of Is_Tagged_Type.
2025-01-07 Eric Botcazou <ebotcazou@adacore.com>
* repinfo.adb (List_GCC_Expression.Print_Expr) <Cond_Expr>: Do not
output the final "end".
2025-01-07 Johannes Kanig <kanig@adacore.com>
* gnat1drv.adb: (SPARK_Library_Warning): preserve Warning_Doc_Switch
2025-01-07 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch4.adb (Expand_Allocator_Expression): Do not build a cleanup
if restriction No_Exception_Propagation is active.
* exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Likewise.
2025-01-06 Eric Botcazou <ebotcazou@adacore.com>
PR ada/118247
* gcc-interface/Make-lang.in (GNATTOOLS_CROSS_MV): Copy gnatbind
instead of moving it.
2025-01-06 Eric Botcazou <ebotcazou@adacore.com>
* exp_aggr.adb (Two_Pass_Aggregate_Expansion): Use the base type of
the index type to find the type used to compute the length.
2025-01-06 Eric Botcazou <ebotcazou@adacore.com>
* libgnat/s-finpri.ads: Remove clause for Ada.Finalization.
(Finalization_Collection): Change to limited private type with the
Finalizable aspect.
(Initialize): Remove "overriding" keyword.
(Finalize): Likewise.
* libgnat/s-finpri.adb (Initialize): Likewise.
(Finalize): Likewise.
2025-01-06 Eric Botcazou <ebotcazou@adacore.com>
PR ada/117569
* sem_ch4.adb (Analyze_Indexed_Component_Form): Do not rewrite the
node as a type conversion if it is the current instance of a type
in a generic unit.
* sem_ch8.adb (Find_Selected_Component): Restrict the special case
of the current instance of a type to a generic unit.
2025-01-06 Bob Duff <duff@adacore.com>
* libgnat/s-imagef.adb (Set_Image_Integer):
Change "RM A.3.10" to be "RM A.10.9".
2025-01-06 Alexandre Oliva <oliva@adacore.com>
* libgnat/g-cppexc.adb (Convert_Caught_Object): Move...
* libgnat/g-cstyin.adb (Convert_Caught_Object): ... here.
Use object call notation.
(strcmp): New.
(Char_Arr, CharPtr, Char_Pointer, To_chars_ptr): Drop. Do not
import Interfaces.C.Pointers.
(To_Pointer): Convert from System.Address.
(Name_Starts_With_Asterisk): Rename local variable.
(Name_Past_Asterisk): Rewrite with System.Address and strcmp.
Import System.Storage_Elements.
(Equals): Use strcmp.
(Before): Fix logic error. Use strcmp.
(Name): Move conversion to String...
* libgnat/g-cppstd.adb (Name): ... here. Import
Interfaces.C.Strings.
* libgnat/g-cppstd.ads (Type_Info_Ptr): Disable heap
finalization.
* libgnat/g-cstyin.ads (Name): Change return type.
2025-01-06 Claire Dross <dross@adacore.com>
* aspects.ads: Add aspect Aspect_Exit_Cases.
* contracts.adb (Analyze_Entry_Or_Subprogram_Contract): Handle Exit_Cases.
(Expand_Subprogram_Contract): Idem.
* einfo-utils.adb (Get_Pragma): Allow Pragma_Exit_Cases.
* einfo-utils.ads (Get_Pragma): Idem.
* exp_prag.adb (Expand_Pragma_Exit_Cases): Ignore the pragma, currently we don't expand it.
* exp_prag.ads (Expand_Pragma_Exit_Cases): Idem.
* inline.adb (Remove_Aspects_And_Pragmas): Add Exit_Cases to the list.
(Remove_Items): Idem.
* par-prag.adb (Last_Arg_Is_Reason): Idem.
* sem_ch12.adb: Idem.
* sem_ch13.adb: Idem.
* sem_util.adb: Idem.
* sem_util.ads: Idem.
* sinfo.ads: Idem.
* snames.ads-tmpl: Add names Name_Exit_Cases, Name_Exception_Raised, and Name_Normal_Return
as well as pragma Pragma_Exit_Cases.
* sem_prag.adb (Analyze_Exit_Cases_In_Decl_Part): Make sure that a
pragma or aspect Exit_Cases is well formed.
(Analyze_Pragma): Make sure that a pragma or aspect Exit_Cases is at the right place.
* sem_prag.ads (Analyze_Exit_Cases_In_Decl_Part): Declaration.
* doc/gnat_rm/implementation_defined_pragmas.rst: Document the Exit_Cases pragma.
* doc/gnat_rm/implementation_defined_aspects.rst: Document the Exit_Cases aspect.
* gnat_rm.texi: Regenerate.
2025-01-06 Bob Duff <duff@adacore.com>
* sem_util.adb (Copy_Subprogram_Spec): When copying
an N_Defining_Operator_Symbol, create an
N_Defining_Operator_Symbol rather than an N_Defining_Identifier.
This will cause Lib.Xref to "skip the initial quote for
navigation purposes" (as per comments in Lib.Xref body).
2025-01-06 Eric Botcazou <ebotcazou@adacore.com>
* exp_aggr.adb (Case_Table_Type): Fix reference in comment.
(In_Place_Assign_OK): Move declaration around.
(Is_Build_In_Place_Aggregate_Return): Likewise and adjust.
(Expand_Array_Aggregate): Streamline for the sake of consistency.
(Aggr_Assignment_OK_For_Backend): Remove reference to Gigi/gcc.
(Backend_Processing_Possible): Likewise.
(Expand_Array_Aggregate): Add comment.
2025-01-06 Bob Duff <duff@adacore.com>
* sinfo.ads (Shift_Count_OK): Update comments.
(Is_Power_Of_2_For_Shift): Likewise.
2025-01-06 Eric Botcazou <ebotcazou@adacore.com>
* debug.adb (dQ): Document usage.
* exp_ch4.ads (Build_Cleanup_For_Allocator): New declaration.
* exp_ch4.adb (Build_Cleanup_For_Allocator): New procedure.
(Expand_Allocator_Expression): Build a cleanup to deallocate the
memory when the evaluation of the expression raises an exception.
* exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Likewise.
* exp_util.adb (Build_Allocate_Deallocate_Proc): Do not generate the
detachment if the deallocation is for the cleanup of an allocator.
* gen_il-fields.ads (Opt_Field_Enum): Add For_Allocator.
* gen_il-gen-gen_nodes.adb (N_Free_Statement): Likewise.
* sinfo.ads (For_Allocator): Document usage on N_Free_Statement.
2025-01-06 Eric Botcazou <ebotcazou@adacore.com>
PR ada/117956
* sem_util.adb (Is_Known_On_Entry): Be prepared for constants coming
from a renaming declaration.
2025-01-06 Tonu Naks <naks@adacore.com>
* adaint.c (__gnat_locate_exec_on_path): modify function signature
2025-01-06 Piotr Trojanek <trojanek@adacore.com>
* sem_prag.adb (Resolve_State): Continue ordinary processing.
2025-01-06 Javier Miranda <miranda@adacore.com>
* sem_ch4.adb (Try_Object_Operation): if no candidate interpretation
matches the context, redo the same analysis with Report_Error True
to report the error.
2025-01-06 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch5.adb (Expand_Assign_Array): Bail out for controlled
components if the RHS is a function call and the assignment has
the No_Ctrl_Actions flag set.
2025-01-06 Viljar Indus <indus@adacore.com>
* diagnostics-json_utils.adb: Add new method
Write_Boolean_Attribute.
* diagnostics-json_utils.ads: Likewise.
* diagnostics-sarif_emitter.adb (Print_Invocations): print
the executionSuccesful property value without extra quotes.
2025-01-06 Viljar Indus <indus@adacore.com>
* diagnostics-sarif_emitter.adb (Print_Rule): Remove printing
of the level attribute since it does not match the SARIF schema.
2025-01-06 Piotr Trojanek <trojanek@adacore.com>
* gen_il-gen.adb (Put_Tables): Add "not null" to the generated code.
* rtsfind.adb (Cstring_Ptr): Same for table with predefined RE_Id
error messages.
* impunit.adb (Aunit_Record): Same for array of alternative unit names.
2025-01-06 Piotr Trojanek <trojanek@adacore.com>
* opt.ads (Ada_Version_Runtime): Now a constant, since it cannot
and should never be modified.
2025-01-06 Bob Duff <duff@adacore.com>
* par-ch10.adb (P_Compilation_Unit): Give an error for "is null".
* sem_ch10.adb (Analyze_Subunit): Remove check for "is null"
as a subunit.
* sem_ch6.adb (Analyze_Subprogram_Declaration):
Remove check for "is null" as a library unit.
2025-01-06 Javier Miranda <miranda@adacore.com>
* sem_ch6.adb (Analyze_Expression_Function): Set the parent of
the new node to be the parent of the original to get the proper
context, which is needed for complete error reporting and for
semantic analysis. Patch suggested by Eric Botcazou.
2025-01-06 Alexandre Oliva <oliva@adacore.com>
Olivier Hainque <hainque@adacore.com>
* Makefile.rtl (LLVM_BUILD): Define based on LLVM_CONFIG.
(GNATRTL_NONTASKING_OBJS): Make g-cpp, g-cppstd, and g-cstyin
conditional on -gcc or -arm EH, and on no LLVM_BUILD.
* raise-gcc.c (GXX_EH_INTEROP): Define as 0 on gnat-llvm or
CERT, and 1 otherwise.
(__gnat_get_cxx_dependent_exception) Omit on !GXX_EH_INTEROP.
(__gnat_maybe_get_cxx_dependent_exception): Likewise.
(__gnat_get_cxx_exception_type_info): Likewise.
(__gnat_obtain_caught_object): Likewise.
(is_handled_by): Omit eid parameter and G++ interop on
!GXX_EH_INTEROP. Adjust callers.
2025-01-06 Eric Botcazou <ebotcazou@adacore.com>
* einfo.ads (Returns_By_Ref): Fix description.
* exp_ch3.adb (Build_Record_Init_Proc.Build_Assignment): Do not
adjust the component manually (if need be), set No_Finalize_Actions
instead of No_Ctrl_Actions for this purpose. Do not adjust when
the expression is a naked function call.
* exp_ch5.adb (Make_Tag_Ctrl_Assignment): Document the quirks of
the function. Assert that the LHS of the assignment does not have
side effects and replace calls to Duplicate_Subexpr_No_Checks with
calls to New_Copy_Tree. Rename local variable Asn to New_N.
(Expand_N_Assignment_Statement): In the tagged or controlled record
case, do remove side effects from both operands on entry. Remove
them in the controlled record case, except if the RHS is a function
call and the assignment has the No_Ctrl_Actions flag set.
* exp_ch6.adb (Expand_Ctrl_Function_Call): Bail out when the parent
node is an assignment statement with the No_Ctrl_Actions flag set.
* sem_util.adb (Statically_Different): Return True for a function
call that does not return its result by reference.
* sinfo.ads (No_Ctrl_Actions): Adjust description and add a note for
the code generator.
(No_Finalize_Actions): Likewise.
2025-01-06 Bob Duff <duff@adacore.com>
* gen_il-gen.adb: Fix too-long line.
2025-01-06 Tonu Naks <naks@adacore.com>
* adaint.c: void parameter on non-windows platforms
2025-01-06 Bob Duff <duff@adacore.com>
* gen_il-internals.ads: Split Fields field into two fields
Imm_Fields and Fields.
* gen_il-gen.adb: Modify the field-inheritance
algorithm to inherit at each level of the type hierarchy,
rather than just inheriting into concrete types.
For example, if C is a concrete type derived from B,
which is in turn derived from A, we now set the Fields
of B to include those of A. (We had always set the Fields
of C to include those of A and B, and we still do that.)
(Compute_Fields_For_One_Type): Detect cases where a given
field is declared for all descendants of a given abstract
type, in which case we should consider declaring it in
the abstract type, and inheriting it in those descendants.
(Exception_To_Inheritance_Rule): These are the cases where
we could inherit, but we don't want to.
* gen_il-gen-gen_nodes.adb: Move fields up the type hierarchy,
so they are inherited instead of being defined separately.
* gen_il-gen-gen_entities.adb: Likewise.
2025-01-06 Viljar Indus <indus@adacore.com>
* sem_ch6.adb (Analyze_Subprogram_Body_Helper):
Exchange_Limited_Views also in Ada 2005.
2025-01-06 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch6.adb (Expand_Call_Helper): Call Ultimate_Alias for the
detection of calls to subprograms specified for Constant_Indexing.
* exp_util.adb (Is_Indexed_Container): Likewise.
(Is_Iterated_Container): Likewise for Default_Iterator.
2025-01-06 Ronan Desplanques <desplanques@adacore.com>
* doc/gnat_ugn/building_executable_programs_with_gnat.rst: Fix markup.
* gnat_ugn.texi: Regenerate.
2025-01-06 Piotr Trojanek <trojanek@adacore.com>
* sem_ch13.adb (Validate_Unchecked_Conversions): Remove detection of
null arrays; remove tests for sizes being present, which are redundant
after calling Known_Static_RM_Size.
2025-01-06 Eric Botcazou <ebotcazou@adacore.com>
PR ada/117936
* doc/gnat_rm/implementation_defined_pragmas.rst
(Unimplemented_Unit): Adjust the description of the error message.
* gnat_rm.texi: Regenerate.
2025-01-05 Estevan Castilho (Tevo) <estevan.cps@gmail.com>
* libgnarl/s-taprop__dummy.adb: Remove use clause for
System.Parameters.
(Unlock): Remove Global_Lock formal parameter.
(Write_Lock): Likewise.
2025-01-03 Piotr Trojanek <trojanek@adacore.com>
* exp_ch3.adb, exp_ch4.adb, exp_disp.adb, inline.adb: Remove explicit
actual parameter Null_Exclusion_Present equal False.
2025-01-03 Piotr Trojanek <trojanek@adacore.com>
* exp_ch3.adb, exp_disp.adb: Remove explicit actual parameter
Constant_Present equal False; tune comments.
2025-01-03 Piotr Trojanek <trojanek@adacore.com>
* exp_ch3.adb, exp_ch9.adb, exp_dist.adb, exp_imgv.adb, exp_util.adb,
sem_dist.adb: Remove explicit actual parameter Aliased_Present equal
False; tune comments and whitespace.
2025-01-03 Piotr Trojanek <trojanek@adacore.com>
* sem_ch5.adb (Check_Call): Reuse Get_Called_Entity.
2025-01-03 Piotr Trojanek <trojanek@adacore.com>
* sem_attr.adb (Check_Array_Type): Remove extra call.
* sem_util.adb (Static_Boolean): Likewise.
2025-01-03 Piotr Trojanek <trojanek@adacore.com>
* exp_aggr.adb (Others_Check): Reuse List_Length; tune whitespace.
* exp_ch3.adb (Constrain_Array): Remove counting of constraints.
* exp_disp.adb (Make_DT): Use Elist utility routines; tune whitespace.
* sem_ch12.adb (Formal_Dimensions): Reuse List_Length.
(Valid_Default_Attribute): Reuse Number_Formals.
* sem_prag.adb (Process_Convention): Likewise.
* sem_util.adb (Normalize_Actuals): Likewise.
(Check_Function_Writable_Actuals): Reuse List_Length.
2025-01-03 Piotr Trojanek <trojanek@adacore.com>
* contracts.adb (Create_Generic_Contract): Remove calls to Present.
* sem_util.adb (Normalize_Actuals): Likewise.
2025-01-03 Bob Duff <duff@adacore.com>
* sem_util.adb (Append_Entity_Name): Do not skip the
simple name for a compilation unit (which includes
the case of specless subprogram bodies).
2025-01-03 Tucker Taft <taft@adacore.com>
* pprint.adb (Expression_Image): Adjust and improve comments
to match style recommendations, and change name of subtype
from Not_Associative to Non_Associative, in response to
code review.
2025-01-03 Tucker Taft <taft@adacore.com>
* pprint.adb (Expression_Image): In local function Expr_Name
add a No_Parens flag and define a subtype Not_Associative
to represent the short-circuit operations and And/Or/Xor.
Insert parentheses to separate the subexpressions when
different "Not_Associative" operations occur in a
sequence.
2025-01-03 Eric Botcazou <ebotcazou@adacore.com>
* einfo.ads (BIP_Initialization_Call): Adjust description.
* exp_ch4.adb (Expand_N_Case_Expression): Adjust commentary.
(Expand_N_If_Expression): Likewise.
* exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration):
Set BIP_Initialization_Call unconditionally in the definite case.
2025-01-03 Piotr Trojanek <trojanek@adacore.com>
* uintp.adb (N_Digits): Refine return subtype, since this routine
always returns a positive number of digits.
2025-01-03 Piotr Trojanek <trojanek@adacore.com>
* checks.adb (Generate_Index_Checks): Reuse existing utility routine.
* sem_ch4.adb (Analyze_Indexed_Component_Form): Likewise.
* sem_prag.adb (Analyze_Pragma): Likewise.
2025-01-03 Piotr Trojanek <trojanek@adacore.com>
* exp_dist.adb (Assign_Subprogram_Identifier,
Reserve_NamingContext_Methods): Simplify.
* osint.adb (Append_Suffix_To_File_Name, Find_File, Get_Directory,
Object_File_Name, Strip_Directory): Likewise.
2025-01-03 Piotr Trojanek <trojanek@adacore.com>
* sem_res.adb (Resolve_Alocator): Move unrelated code out of a declare
block.
2025-01-03 Piotr Trojanek <trojanek@adacore.com>
* exp_ch3.adb (Search_Access_Discriminant, Search_Current_Instance,
Search_Internal_Call): Use traversal function instead of traversal
procedure and remove associated global variables.
* exp_util.adb (Search_Calls): Likewise.
* sem_prag.adb (Contains_Loop_Entry): Likewise.
* sem_util.adb (Mentions_Post_State): Likewise.
2025-01-03 Piotr Trojanek <trojanek@adacore.com>
* sem_attr.adb (Eval_Attribute): Fix comment for attribute Image.
* tbuild.adb (Make_SC): Remove extra whitespace.
2025-01-03 Alexandre Oliva <oliva@adacore.com>
* Makefile.rtl (GNATRTL_NONTASKING_OBJS): Add g-cpp, g-cppstd,
and g-cstyin.
* doc/gnat_rm/interfacing_to_other_languages.rst (Interfacing to C++):
Document class-wide matching and new interfaces.
* exp_prag.adb (Expand_Pragma_Import_Or_Interface): Add class-wide
exception matching support with 'B' as language identifier.
* libgnat/a-exexpr.adb (Setup_Current_Excep): Add Id formal.
(Set_Foreign_Occurrence): Likewise.
(Propagate_GCC_Exception): Adjust.
(Set_Exception_Parameter): Likewise.
(Unhandled_Except_Handler): Likewise.
* libgnat/g-cpp.ads: New.
* libgnat/g-cppexc.adb (Raise_Cpp_Exception): Match 'B' lang id.
(Get_Object_Address): New.
(Get_Object): Rewrite.
(Get_Access_To_Object): New.
(Get_Access_To_Tagged_Object): New.
(Get_Type_Info): New.
(Convert_Caught_Object): New.
* libgnat/g-cppexc.ads (Get_Object_Address): New.
(Get_Object): Note the Cpp Convention requirement.
(Get_Access_To_Object): New.
(Get_Access_To_Tagged_Object): New.
(Get_Type_Info): New.
* libgnat/g-cppstd.adb: New.
* libgnat/g-cppstd.ads: New.
* libgnat/g-csclex.ads: New, unused.
* libgnat/g-cstyin.adb: New.
* libgnat/g-cstyin.ads: New.
* libgnat/g-excact.adb (Exception_Language): New.
(Is_Foreign_Exception): Rewrite.
* libgnat/g-excact.ads (Exception_Languages): New.
(Exception_Language): New.
* libgnat/s-stalib.ads (Lang): Document 'B'.
* raise-gcc.c (__gnat_setup_current_excep): Add Exception_Id formal.
(CXX_DEPENDENT_EXCEPTION_CLASS): New.
(cxx_type_info): New.
(__cxa_exception): Rename exceptionType to encompass PrimaryException.
(_GNAT_Exception): Drop wrapper.
(EID_For): Adjust.
(exception_class_eq): Likewise.
(__gnat_exception_language_is_cplusplus): New.
(__gnat_exception_language_is_ada): New.
(__gnat_convert_caught_object): Declare.
(__gnat_get_cxx_dependent_exception): New.
(__gnat_maybe_get_cxx_dependent_exception): New.
(__gnat_get_cxx_exception_type_info): New.
(__gnat_obtain_caught_object): New.
(is_handled_by): Adjust. [!CERT] Add eid formal, handle dependent
exceptions and base-type matches.
(get_action_description_for) [!CERT]: Add eid formal. Adjust.
(personality_body): Adjust.
* gcc-interface/Make-lang.in (GNAT_ADA_OBJS, GNATBIND_OBJS) [!STAGE1]:
Add new g-cpp, g-cppstd, g-cstyin + preexisting g-cppexc
and i-cstrin.
* gnat-style.texi: Regenerate.
* gnat_rm.texi: Regenerate.
2025-01-03 Gary Dismukes <dismukes@adacore.com>
* diagnostics-constructors.adb (Make_Default_Iterator_Not_Primitive_Error):
Revise message to match message change made in sem_ch13.adb.
* freeze.adb (Freeze_Record_Type): Output appropriate aspect name in
error message, using Get_Name_String.
(Freeze_Entity): For derived types, call Analyze_Aspects_At_Freeze_Point
on the parent type, and call Inherit_Nonoverridable_Aspects on the type
(for both parent type and any progenitor types). Add with_clause for
System.Case_Util.
* gen_il-fields.ads: Add Aspect_Subprograms to type Opt_Field_Enum.
* gen_il-gen-gen_nodes.adb: Add field Aspect_Subprograms to
N_Aspect_Specification nodes.
* sem_ch4.adb (Try_Container_Indexing): Remove Find_Indexing_Operations
and the code calling it. Add new function Indexing_Interpretations for
retrieving the eligible indexing functions from the appropriate aspect's
Aspect_Subprograms list and call that instead of Find_Value_Of_Aspect.
* sem_ch7.adb (Analyze_Package_Specification): In loop over entities,
call Analyze_Aspects_At_Freeze_Point for types that have delayed
aspects.
* sem_ch13.ads (Analyze_Aspects_At_Freeze_Point): Add Nonoverridable_Only
formal to restrict processing to nonoverridable aspects.
(Check_Function_For_Indexing_Aspect): New exported procedure renamed
from Check_One_Function and moved to library level.
* sem_ch13.adb (Analyze_Aspects_At_Freeze_Point): Test new formal
Nonoverridable_Only formal to skip processing of aspects that are not
nonoverridable when the formal is True. Skip the processing for
Aspect_Full_Access_Only when Nonoverridable_Only is True. Call
Check_Indexing_Functions in the case of indexing aspects (procedure
moved from Analyze_Attribute_Definition_Clause to top level).
(Analyze_Aspect_Specifications): Locate closest ancestor type with an
explicit matching aspect to determine the aspect spec to reference in
the error about a nonoverridable aspect not confirming an inherited
aspect (skipping intermediate derived parents). Ensures that we retain
existing errors flagged on explicit ancestor aspects rather than
implicit inherited ones. Change names of variables Parent_Type and
Inherited_Aspect to Ancestor_Type and Ancestor_Aspect respectively
for clarity.
(Analyze_Attribute_Definition_Clause): Move nested subprograms
Check_Iterator_Functions and Check_Primitive_Function to top level
of package. Move Check_Indexing_Functions (and its nested subprograms)
from here to within Analyze_Aspects_At_Freeze_Point (adding some
formal parameters and adjusting the code appropriately, and no longer
call it from this procedure).
(Is_CW_Or_Access_To_CW): Add test for the parent type having the
indexing aspect for proper setting of Aspect_Specification_Is_Inherited.
Delete "???" comment.
(Look_Through_Anon_Access): Remove unneeded tests of Is_Access_Constant
and Name_Constant_Indexing, which lead to wrong messages in some cases.
(Check_Function_For_Indexing_Aspect): Procedure renamed from
Check_One_Function and moved to library level (was nested within
Check_Indexing_Functions), plus added formals (including Valid, to
check result). Move scope test to beginning, to immediately exclude
subprograms not declared immediately within the same scope as the type.
Improve several error messages. Add error checking for Constant_Indexing
functions. Append the function entity to the Aspect_Subprograms list of
the aspect specification. Move code for checking for nonconfirming
index aspects and for checking for illegal indexing aspects on full
views to Check_Indexing_Functions.
(Check_Indexing_Functions): Move procedure Illegal_Indexing from
here to within Check_Function_For_Indexing_Aspect. Add a comment
to the loop over interpretations about the checking being done as
legality rules rather than resolution rules, plus a note referencing
AI22-0084. Check for nonconfirming indexing aspects and illegal
indexing aspects on full views here rather than in Check_One_Function
(now named Check_Function_For_Indexing_Aspect). Remove function
Check_One_Function (moved to library level and renamed), and call
Check_Function_For_Indexing_Aspect instead.
(Check_Inherited_Indexing): Improve spec comment. Remove nested function
Same_Chars, and replace call Same_Chars with call to Sem_Util.Same_Name.
Replace call to Illegal_Indexing with call to Error_Msg_NE.
(Check_One_Function): Unnested from Check_Indexing_Functions, rename
to Check_Function_For_Indexing_Aspect, move body to library level,
and move declaration to Sem_Ch13 spec.
(Analyze_Attribute_Definition_Clause, case Attribute_Default_Iterator):
Improve error message related to tagged-type requirement. Suppress call
to Check_Iterator_Functions for attribute definition clauses associated
with inherited aspects. Remove error checking that is redundant with
checking done in Check_Iterator_Functions.
(Check_Aspect_At_Freeze_Point, case Attribute_Default_Iterator): Call
Check_Iterator_Functions (only if the aspect is not Comes_From_Source).
(Check_Iterator_Functions): Procedure unnested from
Analyze_Attribute_Definition_Clause. Add formals Typ and Expr.
Error messages corrected to say "aspect Default_Iterator" instead of
"aspect Iterator".
(Valid_Default_Iterator): Improve error message to say "must be
a local primitive or class-wide function" instead of "must be
a primitive function".
(Check_Primitive_Function): Unnested from Analyze_Attribute_Definition_Clause.
Add formal Ent.
(Rep_Item_Too_Late): Return False when an attribute_definition_clause
is not Comes_From_Source, since it was generated by the compiler (such
as for an inherited aspect).
(Resolve_Aspect_Aggregate): Capture implementation base type.
(Valid_Empty): Use implementation base types for result type comparison.
(Valid_Add_Named): Use impl base types for comparison of formal's type.
(Valid_Add_Unnamed): Use impl base types for comparison of formal's type.
(Valid_New_Indexed): Use impl base types for result type comparison.
(Validate_Literal_Aspect): Return immediately when aspect does not have
Comes_From_Source True (no point in validating inherited aspects).
* sem_res.adb (Has_Applicable_User_Defined_Literal): Remove Base_Type
comparison and always call Corresponding_Op_Of_Derived_Type for derived
types. Add "???" comment about issue with wrapper functions (and
indicate that it would be nice to eliminate the call to
Corresponding_Primitive_Op).
* sem_util.ads (Inherit_Nonoverridable_Aspects): New procedure.
(Corresponding_Op_Of_Derived_Type): Update spec comment to indicate
return of Ancestor_Op and name changed from Corresponding_Primitive_Op.
* sem_util.adb (Check_Inherited_Nonoverridable_Aspects): Fix name in
header comment.
(Corresponding_Op_Of_Derived_Type): Move declaration of Typ down with
other local variables. Remove Assert that doesn't apply in some cases.
Simply return Ancestor_Op when it isn't a primitive (it can be a
class-wide op). Function name changed from Corresponding_Primitive_Op.
(Find_Untagged_Type_Of): Add test of Is_Type (E) as a guard for checking
Direct_Primitive_Operations. Remove Assert (False), and return Empty
when the primitive is not found.
(Profile_Matches_Ancestor): Change comparisons to use implementation
base types of the operations' formal and result types. Add tests for
interface ancestors. Revise "???" comment.
(Is_Confirming): Simplify name-matching test to use the names associated
with the aspects rather than going to the N_Attribute_Definition_Clause
nodes (may facilitate elimination of those clauses at some point).
(Inherit_Nonoverridable_Aspects): New procedure to traverse the
aspects of a derived type's parent type and create inherited versions
of the parent type's nonoverridable aspects, identifying the appropriate
subprograms for each such inherited aspect.
(Inherit_Nonoverridable_Aspect): New procedure nested in
Inherit_Nonoverridable_Aspects to inherit individual nonoverridable
aspects. Identifies the corresponding subprogram(s) associated with
an inherited nonoverridable aspect. In the case of indexing aspects,
new eligible indexing functions of the type are also identified here,
and the entities of all of the identified subprograms are appended to
the aspect's Aspect_Subprograms Elist. Add a "???" comment about this.
* sinfo.ads: Add documentation for the new Aspect_Subprograms field.
2025-01-03 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch4.adb (Insert_Conditional_Object_Declaration): Create the
Master_Node even if the declaration is turned into a renaming.
2025-01-03 Piotr Trojanek <trojanek@adacore.com>
* sem_ch3.adb (Array_Type_Declaration): Don't copy parent for an itype
created by an array component declaration.
2025-01-03 Douglas B Rupp <rupp@adacore.com>
* socket.c [__vxworks]: Change vxw_h_addr type to long from
int, and cast the conversion of char* to vxw_h_addr to avoid
warning/error.
2025-01-03 Tonu Naks <naks@adacore.com>
* adaint.c: change default behaviour of __gnat_locate_exec_on_path
* adaint.h: change prototype of __gnat_locate_exec_on_path
* libgnat/s-os_lib.adb: pass optional argument in Locate_Exec_On_Path
* libgnat/s-os_lib.ads: change spec of Locate_Exec_On_Path
* libgnat/s-trasym__dwarf.adb: update import of __gnat_locate_exec_on_path
2025-01-03 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch4.adb (Expand_Allocator_Expression): Put back the call to
Remove_Side_Effects in the case of a function call, a class-wide
designated type and a regular storage pool.
2025-01-03 Bob Duff <duff@adacore.com>
* sem_ch6.adb (Analyze_Expression_Function): Mark the implicit
spec for an expression function as Comes_From_Source.
(Analyze_Null_Procedure): Minor cleanup.
* sem_warn.adb (Source_E1): New function to compute whether
to give warnings. In particular, return True for [in] out
parameters of expression functions.
2025-01-03 Steve Baird <baird@adacore.com>
* exp_aggr.adb (Check_Bounds): Remove calls that were setting the
Analyzed flag to False for two aggregate bound expressions.
2025-01-03 Eric Botcazou <ebotcazou@adacore.com>
* einfo.ads (Is_Independent): Document usage on Master_Node objects.
* exp_aggr.adb (In_Place_Assign_OK): Remove Parent_Kind variable.
(Convert_To_Assignments): Call Unconditional_Parent and remove the
restriction on the known size for the in-place expansion of the
aggregate in the context of an object declaration.
(Expand_Array_Aggregate): Remove Parent_Kind variable and call
Unconditional_Parent and Delay_Conditional_Expressions_Between
* exp_ch3.adb: Remove clauses for Exp_Dbug.
(Expand_N_Object_Declaration): Factor out the code rewriting the
declaration as a renaming in Rewrite_Object_Declaration_As_Renaming
and call the procedure.
* exp_ch4.adb (Insert_Conditional_Object_Declaration): Declare.
(Expand_N_Case_Expression): Delay expanding the expression if it is
in the context of an optimizable object declaration. If the parent
node is this object declaration, then replace it with a renaming of
the dereference of an access value designating an object initialized
with the dependent expression chosen by the condition.
(Expand_N_If_Expression): Likewise.
(Insert_Conditional_Object_Declaration): New procedure.
* exp_ch6.adb (Expand_Ctrl_Function_Call): Test the unconditional
parent in the case of an object declaration too.
* exp_ch7.adb (Build_Finalizer.Process_Declarations): Pass Strict to
Processing_Actions from the Is_Independent flag on a Master_Node.
* exp_util.ads (Rewrite_Object_Declaration_As_Renaming): Declare.
* exp_util.adb: Add clauses for Exp_Dbug.
(Rewrite_Object_Declaration_As_Renaming): New procedure extracted
from Expand_N_Object_Declaration.
* sem_ch3.adb (Analyze_Object_Declaration): Also leave the analysis
if the declaration has been replaced with a renaming in the case of
an initialization expression that is a conditional expression.
2025-01-03 Eric Botcazou <ebotcazou@adacore.com>
* checks.adb (Apply_Predicate_Check): Preserve Comes_From_Source.
* exp_ch4.adb (Expand_Allocator_Expression): Factor out common code
for the various cases. Also delay applying the 2nd predicate check.
In the default case, defer to Make_Build_In_Place_Call_In_Allocator
entirely in the build-in-place case.
* sem_ch4.adb (Analyze_Allocator): Do not give the warning or error
for a default-initialized allocator with No_Initialization.
2025-01-03 Ronan Desplanques <desplanques@adacore.com>
* lib-writ.adb (Write_ALI): Remove useless space.
2025-01-03 Ronan Desplanques <desplanques@adacore.com>
* lib-writ.adb (Write_ALI): Remove condition for writing P line
parameters.
* lib-writ.ads: Fix typos. Clarify comment.
2025-01-02 Jakub Jelinek <jakub@redhat.com>
* gnat_ugn.texi: Bump @copying's copyright year.
* gnat_rm.texi: Likewise.
Copyright (C) 2025 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.
|