summaryrefslogtreecommitdiff
path: root/gcc/ChangeLog.omp
blob: a1103c0d135db09b2490cf23e98c846e1395f404 (plain)
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
2025-04-17  Kwok Cheung Yeung  <kcyeung@baylibre.com>

	* gimplify.cc (gimplify_omp_affinity): Use macros for accessing
	iterator elements.
	(compute_omp_iterator_count): Likewise.
	(build_omp_iterator_loop): Likewise.
	(remove_unused_omp_iterator_vars): Likewise.
	(build_omp_iterators_loops): Likewise.
	(enter_omp_iterator_loop_context_1): Likewise.
	(extract_base_bit_offset): Likewise.
	* omp-low.cc (lower_omp_map_iterator_expr): Likewise.
	(lower_omp_map_iterator_size): Likewise.
	(allocate_omp_iterator_elems): Likewise.
	(free_omp_iterator_elems): Likewise.
	* tree-inline.cc (copy_tree_body_r): Likewise.
	* tree-pretty-print.cc (dump_omp_iterators): Likewise.
	* tree.h (OMP_ITERATORS_VAR, OMP_ITERATORS_BEGIN, OMP_ITERATORS_END,
	OMP_ITERATORS_STEP, OMP_ITERATORS_ORIG_STEP, OMP_ITERATORS_BLOCK,
	OMP_ITERATORS_LABEL, OMP_ITERATORS_INDEX, OMP_ITERATORS_ELEMS,
	OMP_ITERATORS_COUNT, OMP_ITERATORS_EXPANDED_P): New macros.

2025-04-17  Kwok Cheung Yeung  <kcyeung@baylibre.com>

	* gimplify.cc (omp_iterator_elems_length): New.
	(build_omp_iterators_loops): Change type of elements
	array to pointer of pointers if array length is non-constant, and
	assign size with indirect reference.  Reorder elements added to
	iterator vector and add element containing the iteration count.  Use
	omp_iterator_elems_length to compute element array size required.
	* gimplify.h (omp_iterator_elems_length): New prototype.
	* omp-low.cc (lower_omp_map_iterator_expr): Reorder elements read
	from iterator vector.  If elements field is a pointer type, assign
	using pointer arithmetic followed by indirect reference, and return
	the field directly.
	(lower_omp_map_iterator_size): Reorder elements read from iterator
	vector.  If elements field is a pointer type, assign using pointer
	arithmetic followed by indirect reference.
	(allocate_omp_iterator_elems): New.
	(free_omp_iterator_elems): New.
	(lower_omp_target): Call allocate_omp_iterator_elems before inserting
	loops sequence, and call free_omp_iterator_elems afterwards.
	* tree-pretty-print.cc (dump_omp_iterators): Print extra elements in
	iterator vector.

2025-04-17  Kwok Cheung Yeung  <kcyeung@baylibre.com>

	* gimplify.cc (compute_omp_iterator_count): Account for difference
	in loop boundaries in Fortran.
	(build_omp_iterator_loop): Change upper boundary condition for
	Fortran.  Insert block statements into innermost loop.
	(remove_unused_omp_iterator_vars): Copy block subblocks of old
	iterator to new iterator and remove original.
	(contains_vars_1): New.
	(contains_vars): New.
	(extract_base_bit_offset): Add iterator argument.  Remove iterator
	variables from base.  Do not set variable_offset if the offset
	does not contain any remaining variables.
	(omp_accumulate_sibling_list): Add iterator argument to
	extract_base_bit_offset.
	* tree-pretty-print.cc (dump_block_node): Ignore BLOCK_SUBBLOCKS
	containing iterator block statements.

2025-04-17  Kwok Cheung Yeung  <kcyeung@baylibre.com>

	* gimplify.cc (gimplify_scan_omp_clauses): Add argument for iterator
	loop sequence.   Gimplify the clause decl and size into the iterator
	loop if iterators are used.
	(gimplify_omp_workshare): Add argument for iterator loops sequence
	in call to gimplify_scan_omp_clauses.
	(gimplify_omp_target_update): Call remove_unused_omp_iterator_vars and
	build_omp_iterators_loops.  Add loop sequence as argument when calling
	gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses and building
	the Gimple statement.
	* tree-pretty-print.cc (dump_omp_clause): Call dump_omp_iterators
	for to/from clauses with iterators.
	* tree.cc (omp_clause_num_ops): Add extra operand for OMP_CLAUSE_FROM
	and OMP_CLAUSE_TO.
	* tree.h (OMP_CLAUSE_HAS_ITERATORS): Add check for OMP_CLAUSE_TO and
	OMP_CLAUSE_FROM.
	(OMP_CLAUSE_ITERATORS): Likewise.

2025-04-17  Kwok Cheung Yeung  <kcyeung@baylibre.com>

	* gimple-pretty-print.cc (dump_gimple_omp_target): Print expanded
	iterator loops.
	* gimple.cc (gimple_build_omp_target): Add argument for iterator
	loops sequence.  Initialize iterator loops field.
	* gimple.def (GIMPLE_OMP_TARGET): Set GSS symbol to GSS_OMP_TARGET.
	* gimple.h (gomp_target): Set GSS symbol to GSS_OMP_TARGET.  Add extra
	field for iterator loops.
	(gimple_build_omp_target): Add argument for iterator loops sequence.
	(gimple_omp_target_iterator_loops): New.
	(gimple_omp_target_iterator_loops_ptr): New.
	(gimple_omp_target_set_iterator_loops): New.
	* gimplify.cc (find_var_decl): New.
	(copy_omp_iterator): New.
	(remap_omp_iterator_var_1): New.
	(remap_omp_iterator_var): New.
	(remove_unused_omp_iterator_vars): New.
	(struct iterator_loop_info_t): New type.
	(iterator_loop_info_map_t): New type.
	(build_omp_iterators_loops): New.
	(enter_omp_iterator_loop_context_1): New.
	(enter_omp_iterator_loop_context): New.
	(enter_omp_iterator_loop_context): New.
	(exit_omp_iterator_loop_context): New.
	(gimplify_adjust_omp_clauses): Add argument for iterator loop
	sequence.  Gimplify the clause decl and size into the iterator
	loop if iterators are used.
	(gimplify_omp_workshare): Call remove_unused_omp_iterator_vars and
	build_omp_iterators_loops for OpenMP target expressions.  Add
	loop sequence as argument when calling gimplify_adjust_omp_clauses
	and building the Gimple statement.
	* gimplify.h (enter_omp_iterator_loop_context): New prototype.
	(exit_omp_iterator_loop_context): New prototype.
	* gsstruct.def (GSS_OMP_TARGET): New.
	* omp-low.cc (lower_omp_map_iterator_expr): New.
	(lower_omp_map_iterator_size): New.
	(finish_omp_map_iterators): New.
	(lower_omp_target): Add sorry if iterators used with deep mapping.
	Call lower_omp_map_iterator_expr before assigning to sender ref.
	Call lower_omp_map_iterator_size before setting the size.  Insert
	iterator loop sequence before the statements for the target clause.
	* tree-nested.cc (convert_nonlocal_reference_stmt): Walk the iterator
	loop sequence of OpenMP target statements.
	(convert_local_reference_stmt): Likewise.
	(convert_tramp_reference_stmt): Likewise.
	* tree-pretty-print.cc (dump_omp_iterators): Dump extra iterator
	information if present.
	(dump_omp_clause): Call dump_omp_iterators for iterators in map
	clauses.
	* tree.cc (omp_clause_num_ops): Add operand for OMP_CLAUSE_MAP.
	(walk_tree_1): Do not walk last operand of OMP_CLAUSE_MAP.
	* tree.h (OMP_CLAUSE_HAS_ITERATORS): New.
	(OMP_CLAUSE_ITERATORS): New.

2025-04-17  Kwok Cheung Yeung  <kcyeung@baylibre.com>

	* gimplify.cc (gimplify_omp_affinity): Use OMP_ITERATOR_DECL_P.
	(compute_omp_iterator_count): New.
	(build_omp_iterator_loop): New.
	(gimplify_omp_depend): Use OMP_ITERATOR_DECL_P,
	compute_omp_iterator_count and build_omp_iterator_loop.
	* tree-inline.cc (copy_tree_body_r): Use OMP_ITERATOR_DECL_P.
	* tree-pretty-print.cc (dump_omp_clause): Likewise.
	* tree.h (OMP_ITERATOR_DECL_P): New macro.

2025-04-17  Thomas Schwinge  <tschwinge@baylibre.com>

	Backported from trunk:
	2025-04-16  Thomas Schwinge  <tschwinge@baylibre.com>

	PR target/97106
	* config/nvptx/nvptx.cc (nvptx_asm_output_def_from_decls)
	[ACCEL_COMPILER]: Make sure to emit C++ constructor, destructor
	aliases.

	Backported from trunk:
	2025-04-14  Thomas Schwinge  <tschwinge@baylibre.com>

	PR target/118794
	* config/gcn/gcn.opt (-mfake-exceptions): Support.
	* config/nvptx/nvptx.opt (-mfake-exceptions): Likewise.
	* config/gcn/gcn.md (define_expand "exception_receiver"): Use it.
	* config/nvptx/nvptx.md (define_expand "exception_receiver"):
	Likewise.
	* config/gcn/mkoffload.cc (main): Set it.
	* config/nvptx/mkoffload.cc (main): Likewise.
	* config/nvptx/nvptx.cc (nvptx_assemble_integer)
	<in_section == exception_section>: Special handling for
	'SYMBOL_REF's.
	* except.cc (expand_dw2_landing_pad_for_region): Don't generate
	bogus code for (default)
	'#define EH_RETURN_DATA_REGNO(N) INVALID_REGNUM'.

	Backported from trunk:
	2025-04-07  Thomas Schwinge  <tschwinge@baylibre.com>

	* config/nvptx/nvptx.opt (-mfake-ptx-alloca): Update.

	Backported from trunk:
	2025-04-03  Thomas Schwinge  <tschwinge@baylibre.com>

	PR target/119573
	* config/nvptx/nvptx.cc (nvptx_encode_section_info): Don't set
	'DATA_AREA_CONST' for 'TREE_CONSTANT', or 'TREE_READONLY'.
	(nvptx_asm_declare_constant_name): Use '.global' instead of
	'.const'.

	Backported from trunk:
	2025-04-08  Thomas Schwinge  <tschwinge@baylibre.com>

	* config/nvptx/nvptx.cc (nvptx_asm_output_def_from_decls)
	[!ACCEL_COMPILER]: Don't define label 'emit_ptx_alias'.

2025-04-08  Tobias Burnus  <tburnus@baylibre.com>

	Backported from master:
	2025-04-08  Tobias Burnus  <tburnus@baylibre.com>

	PR middle-end/119662
	* gimplify.cc (modify_call_for_omp_dispatch): Fix GOMP_interop
	arg passing; add location info to function calls.

2025-04-02  Thomas Schwinge  <tschwinge@baylibre.com>

	Backported from trunk:
	2025-04-01  Thomas Schwinge  <tschwinge@baylibre.com>

	PR target/119369
	* config/gcn/gcn-protos.h (gcn_asm_weaken_decl): Declare.
	* config/gcn/gcn.cc (gcn_asm_weaken_decl): New.
	* config/gcn/gcn-hsa.h (ASM_WEAKEN_DECL): '#define' to this.

2025-04-01  Tobias Burnus  <tburnus@baylibre.com>

	Backported from master:
	2025-04-01  Tobias Burnus  <tburnus@baylibre.com>

	PR middle-end/119559
	* gimplify.cc (modify_call_for_omp_dispatch): Reorder checks to avoid
	asserts and bogus diagnostic.

2025-03-31  Tobias Burnus  <tburnus@baylibre.com>

	Backported from master:
	2025-03-31  Tobias Burnus  <tburnus@baylibre.com>

	PR middle-end/119541
	* gimplify.cc (modify_call_for_omp_dispatch): Limit interop claues
	processing by the number of append_args arguments.

2025-03-27  Tobias Burnus  <tburnus@baylibre.com>

	Backported from master:
	2025-03-27  Tobias Burnus  <tburnus@baylibre.com>

	* gimplify.cc (modify_call_for_omp_dispatch): Remove sorry.

2025-03-27  Thomas Schwinge  <tschwinge@baylibre.com>

	Backported from trunk:
	2025-03-26  Thomas Schwinge  <thomas@codesourcery.com>

	PR driver/101544
	* gcc.cc (driver_handle_option): Forward host '-lstdc++' to
	offloading compilation.
	* config/gcn/mkoffload.cc (main): Adjust.
	* config/nvptx/mkoffload.cc (main): Likewise.

2025-03-25  Thomas Schwinge  <tschwinge@baylibre.com>

	Backported from trunk:
	2025-03-24  Thomas Schwinge  <tschwinge@baylibre.com>

	PR target/101544
	* config/nvptx/nvptx.cc (nvptx_asm_output_def_from_decls)
	[ACCEL_COMPILER]: Special-case certain host-setup symbol aliases.
	* varasm.cc (do_assemble_alias) [ACCEL_COMPILER]: Adjust.

	Backported from trunk:
	2025-03-24  Thomas Schwinge  <tschwinge@baylibre.com>

	* config/nvptx/nvptx.cc (default_ptx_version_option): Default at
	least to '-mptx=6.3'.
	* doc/invoke.texi (Nvidia PTX Options): Update '-mptx=[...]'.

2025-03-21  Paul-Antoine Arras  <parras@baylibre.com>

	Backported from master:
	2025-03-21  Paul-Antoine Arras  <parras@baylibre.com>
		    Tobias Burnus  <tburnus@baylibre.com>

	* builtin-types.def
	(BT_FN_VOID_INT_INT_PTR_PTR_PTR_INT_PTR_INT_PTR_UINT_PTR): New.
	* gimple-low.cc (lower_stmt): Handle GIMPLE_OMP_INTEROP.
	* gimple-pretty-print.cc (dump_gimple_omp_interop): New function.
	(pp_gimple_stmt_1): Handle GIMPLE_OMP_INTEROP.
	* gimple.cc (gimple_build_omp_interop): New function.
	(gimple_copy): Handle GIMPLE_OMP_INTEROP.
	* gimple.def (GIMPLE_OMP_INTEROP): Define.
	* gimple.h (gimple_build_omp_interop): Declare.
	(gimple_omp_interop_clauses): New function.
	(gimple_omp_interop_clauses_ptr): Likewise.
	(gimple_omp_interop_set_clauses): Likewise.
	(gimple_return_set_retval): Handle GIMPLE_OMP_INTEROP.
	* gimplify.cc (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_INIT,
	OMP_CLAUSE_USE and OMP_CLAUSE_DESTROY.
	(gimplify_omp_interop): New function.
	(gimplify_expr): Replace sorry with call to gimplify_omp_interop.
	* omp-builtins.def (BUILT_IN_GOMP_INTEROP): Define.
	* omp-low.cc (scan_sharing_clauses): Handle OMP_CLAUSE_INIT,
	OMP_CLAUSE_USE and OMP_CLAUSE_DESTROY.
	(scan_omp_1_stmt): Handle GIMPLE_OMP_INTEROP.
	(lower_omp_interop_action_clauses): New function.
	(lower_omp_interop): Likewise.
	(lower_omp_1): Handle GIMPLE_OMP_INTEROP.

2025-03-19  Thomas Schwinge  <tschwinge@baylibre.com>

	Backported from trunk:
	2025-03-14  Thomas Schwinge  <thomas@codesourcery.com>

	PR target/92713
	PR target/101544
	* config/gcn/gcn.h (LIBSTDCXX): Don't set.
	* config/nvptx/nvptx.h (LIBSTDCXX): Likewise.

2025-02-28  Thomas Schwinge  <tschwinge@baylibre.com>

	Backported from trunk:
	2025-02-27  Thomas Schwinge  <tschwinge@baylibre.com>

	* config/nvptx/nvptx.h (MAX_FIXED_MODE_SIZE): '#define'.

	Backported from trunk:
	2025-02-27  Thomas Schwinge  <tschwinge@baylibre.com>

	* config/nvptx/nvptx.opt (-mfake-ptx-alloca): New.
	* config/nvptx/nvptx-protos.h (nvptx_output_fake_ptx_alloca):
	Declare.
	* config/nvptx/nvptx.cc (nvptx_output_fake_ptx_alloca): New.
	* config/nvptx/nvptx.md (define_insn "@nvptx_alloca_<mode>")
	[!(TARGET_PTX_7_3 && TARGET_SM52)]: Use it for
	'-mfake-ptx-alloca'.

	Backported from trunk:
	2025-02-27  Thomas Schwinge  <tschwinge@baylibre.com>

	* config/nvptx/nvptx.md (define_expand "allocate_stack")
	[!TARGET_SOFT_STACK]: Move
	'sorry ("dynamic stack allocation not supported");'...
	(define_insn "@nvptx_alloca_<mode>"): ... here.

2025-02-27  Thomas Schwinge  <tschwinge@baylibre.com>

	Backported from trunk:
	2025-02-22  Thomas Schwinge  <tschwinge@baylibre.com>

	* config/bpf/bpf.md (define_expand "allocate_stack"): Emit
	'sorry, unimplemented: dynamic stack allocation not supported'.
	* config/nvptx/nvptx.md (define_expand "allocate_stack")
	[!TARGET_SOFT_STACK && !(TARGET_PTX_7_3 && TARGET_SM52)]: Likewise.

2025-02-18  Thomas Schwinge  <tschwinge@baylibre.com>

	Backported from trunk:
	2025-02-14  Thomas Schwinge  <tschwinge@baylibre.com>

	PR target/94282
	PR target/113331
	* common/config/gcn/gcn-common.cc (gcn_except_unwind_info): 'return UI_TARGET;'.
	* config/gcn/gcn.cc (gcn_asm_init_sections): New function.
	(TARGET_ASM_INIT_SECTIONS): '#define'.

	Backported from trunk:
	2025-02-14  Thomas Schwinge  <tschwinge@baylibre.com>

	PR target/86660
	* common/config/nvptx/nvptx-common.cc (nvptx_except_unwind_info):
	'return UI_TARGET;'.
	* config/nvptx/nvptx.cc (nvptx_assemble_integer): Handle
	'exception_section'.
	(nvptx_output_section_asm_op, nvptx_asm_init_sections): New
	functions.
	(TARGET_ASM_INIT_SECTIONS): '#define'.
	* config/nvptx/nvptx.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP):
	Don't '#define'.
	(ASM_OUTPUT_DWARF_DELTA): '#define'.

	Backported from trunk:
	2025-02-14  Thomas Schwinge  <tschwinge@baylibre.com>

	* config/nvptx/nvptx.cc (init_frag): New 'bool active' member.
	(output_init_frag, nvptx_assemble_value, nvptx_assemble_integer)
	(nvptx_output_skip, nvptx_assemble_decl_begin)
	(nvptx_assemble_decl_end): Sanity-check its state.

	Backported from trunk:
	2025-02-14  Thomas Schwinge  <tschwinge@baylibre.com>

	* config/nvptx/nvptx.cc (nvptx_output_skip): Clarify case of
	no or incomplete initializer.

	Backported from trunk:
	2025-02-08  Thomas Schwinge  <tschwinge@baylibre.com>

	* config/gcn/gcn.md (exception_receiver): 'define_expand'.
	* config/nvptx/nvptx.md (exception_receiver): Likewise.

	Backported from trunk:
	2025-02-08  Thomas Schwinge  <tschwinge@baylibre.com>

	* doc/sourcebuild.texi (Effective-Target Keywords): Clarify that
	effective-target 'exceptions' and 'exceptions_enabled' are
	orthogonal.

	Backported from trunk:
	2024-05-22  Roger Sayle  <roger@nextmovesoftware.com>

	* except.cc (output_function_exception_table): Move call to
	get_personality_function after targetm_common.except_unwind_info
	check, to avoid ICE on targets that don't support exceptions.

	Backported from trunk:
	2025-02-07  Thomas Schwinge  <tschwinge@baylibre.com>

	* c-gimplify.cc (c_genericize): Pass 'local_dump_flags' to
	'print_c_tree'.
	* c-pretty-print.cc (c_pretty_printer::statement): Pass
	'dump_flags' to 'dump_generic_node'.
	(c_pretty_printer::c_pretty_printer): Initialize 'dump_flags'.
	(print_c_tree): Add 'dump_flags_t' formal parameter.
	(debug_c_tree): Adjust.
	* c-pretty-print.h (c_pretty_printer): Add 'dump_flags_t
	dump_flags'.
	(c_pretty_printer::c_pretty_printer): Add 'dump_flags_t' formal
	parameter.
	(print_c_tree): Adjust.

	Backported from trunk:
	2025-01-28  Thomas Schwinge  <tschwinge@baylibre.com>

	* tree-pretty-print.cc (dump_omp_clause): Clarify
	'OMP_CLAUSE_MAP_RUNTIME_IMPLICIT_P'.

	Backported from trunk:
	2025-01-08  Thomas Schwinge  <tschwinge@baylibre.com>

	* doc/invoke.texi (Nvidia PTX Options): Update '-march-map=sm_50'.

	Backported from trunk:
	2025-01-20  Thomas Schwinge  <tschwinge@baylibre.com>

	* config/nvptx/t-nvptx (MULTILIB_OPTIONS): Don't add 'mptx=3.1' if
	neither sm_30 nor sm_35 multilib variant is built.

	Backported from trunk:
	2024-09-24  Prathamesh Kulkarni  <prathameshk@nvidia.com>
		    Thomas Schwinge  <tschwinge@baylibre.com>

	PR target/104957
	* config/nvptx/nvptx.cc (nvptx_asm_output_def_from_decls): Use
	cgraph_node::get(name)->ultimate_alias_target instead of value.

	Backported from trunk:
	2024-09-05  Thomas Schwinge  <tschwinge@baylibre.com>

	PR target/104957
	* config/nvptx/nvptx.cc (write_fn_proto_1): Revert 2022-03-22
	change; 'write_fn_marker' also for alias DECL.
	(nvptx_asm_output_def_from_decls): 'write_fn_marker' for alias
	DEF.

2025-01-30  Tobias Burnus  <tburnus@baylibre.com>

	Backported from master:
	2025-01-30  Tobias Burnus  <tburnus@baylibre.com>

	* gimplify.cc (gimplify_call_expr): For OpenMP's append_args clause
	processed by 'omp dispatch', update for internal-representation
	changes; fix handling of hidden arguments, add some comments and
	handle Fortran's value dummy and optional/pointer/allocatable actual
	args.

2025-01-28  Tobias Burnus  <tburnus@baylibre.com>

	Backported from master:
	2025-01-09  Tobias Burnus  <tburnus@baylibre.com>

	* builtin-types.def (BT_FN_PTRMODE_PTR_INT_PTR): Add.
	* gimplify.cc (gimplify_call_expr): Add error for multiple
	list items to the OpenMP interop clause if no device clause;
	continue instead of restarting after append_args handling.
	(gimplify_omp_dispatch): Extract device number from the
	single interop-clause list item.
	* omp-builtins.def (BUILT_IN_OMP_GET_INTEROP_INT): Add.

2025-01-28  Tobias Burnus  <tburnus@baylibre.com>

	Backported from master:
	2025-01-08  Tobias Burnus  <tburnus@baylibre.com>

	* gimplify.cc (gimplify_call_expr): Disable variant function's
	append_args in 'omp dispatch' when invoking the variant directly
	and not through the base function.

2025-01-28  Tobias Burnus  <tburnus@baylibre.com>

	Backported from master:
	2024-12-18  Tobias Burnus  <tburnus@baylibre.com>

	* gimplify.cc (gimplify_call_expr): Update for OpenMP's
	append_args; cleanup of OpenMP's dispatch clause handling.

2025-01-27  Tobias Burnus  <tburnus@baylibre.com>

	Backported from master:
	2024-12-19  Tobias Burnus  <tburnus@baylibre.com>

	* omp-general.cc (vendor_properties): Add "nec".

2025-01-27  Tobias Burnus  <tburnus@baylibre.com>

	Backported from master:
	2024-12-12  Tobias Burnus  <tburnus@baylibre.com>

	* gimplify.cc (gimplify_call_expr): When handling OpenMP's dispatch,
	add diagnostic when there is a ptr vs. addr mismatch between
	need_device_{addr,ptr} and {is,has}_device_{ptr,addr}, respectively.

2025-01-27  Tobias Burnus  <tburnus@baylibre.com>

	Backported from master:
	2024-11-22  Tobias Burnus  <tburnus@baylibre.com>

	* gimplify.cc (gimplify_call_expr): Add initial support for
	dispatch's 'interop' clause.
	(gimplify_scan_omp_clauses): Handle interop clause.
	* tree-pretty-print.cc (dump_omp_clause): Likewise.
	* tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_INTEROP.
	* tree.cc (omp_clause_num_ops, omp_clause_code_name): Add interop.

2025-01-27  Tobias Burnus  <tburnus@baylibre.com>

	Backported from master:
	2024-11-22  Tobias Burnus  <tburnus@baylibre.com>

	* gimplify.cc (gimplify_expr): Handle OMP_INTEROP by printing
	"sorry, uninplemented".
	* omp-api.h (omp_get_fr_id_from_name): Change return type to
	'char'.
	* omp-general.cc (omp_get_fr_id_from_name): Likewise; return
	GOMP_INTEROP_IFR_UNKNOWN not 0 if not found.
	(omp_get_name_from_fr_id): Return "<unknown>" not NULL
	if not found (used for dumps).
	* tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_DESTROY,
	OMP_CLAUSE_USE, and OMP_CLAUSE_INIT.
	* tree-pretty-print.cc (dump_omp_init_prefer_type): New.
	(dump_omp_clause): Handle init, use and destroy clauses.
	(dump_generic_node): Handle interop directive.
	* tree.cc (omp_clause_num_ops, omp_clause_code_name): Add new
	init/use/destroy clauses.
	* tree.def (OACC_LOOP): Fix comment.
	(OMP_INTEROP): Add.
	* tree.h (OMP_INTEROP_CLAUSES, OMP_CLAUSE_INIT_TARGET,
	OMP_CLAUSE_INIT_TARGETSYNC, OMP_CLAUSE_INIT_PREFER_TYPE): New.

2025-01-27  Paul-Antoine Arras  <parras@baylibre.com>

	Backported from master:
	2025-01-07  Paul-Antoine Arras  <parras@baylibre.com>

	* gimplify.cc (gimplify_call_expr): Create variable
	variant_substituted_p to control whether adjust_args applies.

2025-01-27  Paul-Antoine Arras  <parras@baylibre.com>

	Backported from master:
	2025-01-02  Paul-Antoine Arras  <parras@baylibre.com>

	* gimplify.cc (gimplify_call_expr): Fix handling of need_device_ptr for
	type(c_ptr). Fix handling of nested function calls in a dispatch region.
	(find_ifn_gomp_dispatch): Return the IFN without stripping it.
	(gimplify_omp_dispatch): Keep IFN_GOMP_DISPATCH until
	gimplify_call_expr.

2025-01-24  Paul-Antoine Arras  <parras@baylibre.com>

	Backported from master:
	2024-11-20  Paul-Antoine Arras  <parras@baylibre.com>

	* builtins.cc (builtin_fnspec): Handle BUILT_IN_OMP_GET_MAPPED_PTR.
	* gimple-low.cc (lower_stmt): Handle GIMPLE_OMP_DISPATCH.
	* gimple-pretty-print.cc (dump_gimple_omp_dispatch): New function.
	(pp_gimple_stmt_1): Handle GIMPLE_OMP_DISPATCH.
	* gimple-walk.cc (walk_gimple_stmt): Likewise.
	* gimple.cc (gimple_build_omp_dispatch): New function.
	(gimple_copy): Handle GIMPLE_OMP_DISPATCH.
	* gimple.def (GIMPLE_OMP_DISPATCH): Define.
	* gimple.h (gimple_build_omp_dispatch): Declare.
	(gimple_has_substatements): Handle GIMPLE_OMP_DISPATCH.
	(gimple_omp_dispatch_clauses): New function.
	(gimple_omp_dispatch_clauses_ptr): Likewise.
	(gimple_omp_dispatch_set_clauses): Likewise.
	(gimple_return_set_retval): Handle GIMPLE_OMP_DISPATCH.
	* gimplify.cc (enum omp_region_type): Add ORT_DISPATCH.
	(struct gimplify_omp_ctx): Add in_call_args.
	(gimplify_call_expr): Handle need_device_ptr arguments.
	(is_gimple_stmt): Handle OMP_DISPATCH.
	(gimplify_scan_omp_clauses): Handle OMP_CLAUSE_DEVICE in a dispatch
	construct. Handle OMP_CLAUSE_NOVARIANTS and OMP_CLAUSE_NOCONTEXT.
	(omp_has_novariants): New function.
	(omp_has_nocontext): Likewise.
	(omp_construct_selector_matches): Handle OMP_DISPATCH with nocontext
	clause.
	(find_ifn_gomp_dispatch): New function.
	(gimplify_omp_dispatch): Likewise.
	(gimplify_expr): Handle OMP_DISPATCH.
	* gimplify.h (omp_has_novariants): Declare.
	* internal-fn.cc (expand_GOMP_DISPATCH): New function.
	* internal-fn.def (GOMP_DISPATCH): Define.
	* omp-builtins.def (BUILT_IN_OMP_GET_MAPPED_PTR): Define.
	(BUILT_IN_OMP_GET_DEFAULT_DEVICE): Define.
	(BUILT_IN_OMP_SET_DEFAULT_DEVICE): Define.
	* omp-general.cc (omp_construct_traits_to_codes): Add OMP_DISPATCH.
	(struct omp_ts_info): Add dispatch.
	(omp_resolve_declare_variant): Handle novariants. Adjust
	DECL_ASSEMBLER_NAME.
	* omp-low.cc (scan_omp_1_stmt): Handle GIMPLE_OMP_DISPATCH.
	(lower_omp_dispatch): New function.
	(lower_omp_1): Call it.
	* tree-inline.cc (remap_gimple_stmt): Handle GIMPLE_OMP_DISPATCH.
	(estimate_num_insns): Handle GIMPLE_OMP_DISPATCH.

2025-01-23  Paul-Antoine Arras  <parras@baylibre.com>

	Backported from master:
	2024-11-20  Paul-Antoine Arras  <parras@baylibre.com>

	* builtin-types.def (BT_FN_PTR_CONST_PTR_INT): New.
	* omp-selectors.h (enum omp_ts_code): Add OMP_TRAIT_CONSTRUCT_DISPATCH.
	* tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_NOVARIANTS and
	OMP_CLAUSE_NOCONTEXT.
	* tree-pretty-print.cc (dump_omp_clause): Handle OMP_CLAUSE_NOVARIANTS
	and OMP_CLAUSE_NOCONTEXT.
	(dump_generic_node): Handle OMP_DISPATCH.
	* tree.cc (omp_clause_num_ops): Add OMP_CLAUSE_NOVARIANTS and
	OMP_CLAUSE_NOCONTEXT.
	(omp_clause_code_name): Add "novariants" and "nocontext".
	* tree.def (OMP_DISPATCH): New.
	* tree.h (OMP_DISPATCH_BODY): New macro.
	(OMP_DISPATCH_CLAUSES): New macro.
	(OMP_CLAUSE_NOVARIANTS_EXPR): New macro.
	(OMP_CLAUSE_NOCONTEXT_EXPR): New macro.

2025-01-23  Tobias Burnus  <tburnus@baylibre.com>

	Backported from master:
	2024-10-28  Tobias Burnus  <tburnus@baylibre.com>

	* tree-core.h (enum omp_clause_code): Add comments to cross ref to
	OMP_CLAUSE_DECL etc. and mark the ranges used in the range checks.

2025-01-23  Tobias Burnus  <tburnus@baylibre.com>

	Backported from master:
	2024-09-23  Tobias Burnus  <tburnus@baylibre.com>

	* omp-general.cc (omp_runtime_api_procname): Strip "omp_" from
	string; move get_device_from_uid as now a '_' suffix exists.

2025-01-23  Tobias Burnus  <tburnus@baylibre.com>

	Backported from master:
	2024-09-20  Tobias Burnus  <tburnus@baylibre.com>

	* omp-general.cc (omp_runtime_api_procname): Add
	get_device_from_uid and omp_get_uid_from_device routines.

2025-01-23  Tobias Burnus  <tburnus@baylibre.com>

	Backported from master:
	2024-09-13  Tobias Burnus  <tburnus@baylibre.com>

	PR fortran/116661
	* omp-api.h (omp_get_fr_id_from_name, omp_get_name_from_fr_id): New
	prototypes.
	* omp-general.cc (omp_get_fr_id_from_name, omp_get_name_from_fr_id):
	New.

2025-01-23  Tobias Burnus  <tburnus@baylibre.com>

	Backported from master:
	2024-09-11  Tobias Burnus  <tburnus@baylibre.com>

	* omp-general.cc (omp_runtime_api_procname): Add
	omp_get_interop_{int,name,ptr,rc_desc,str,type_desc}
	and omp_get_num_interop_properties.

2024-12-19  Thomas Schwinge  <tschwinge@baylibre.com>

	PR target/65181
	* config/nvptx/nvptx.cc (nvptx_get_drap_rtx): Handle
	'!TARGET_SOFT_STACK'.
	* config/nvptx/nvptx.md (define_c_enum "unspec"): Add
	'UNSPEC_STACKSAVE', 'UNSPEC_STACKRESTORE'.
	(define_expand "allocate_stack", define_expand "save_stack_block")
	(define_expand "save_stack_block"): Handle '!TARGET_SOFT_STACK',
	PTX 'alloca'.
	(define_insn "@nvptx_alloca_<mode>")
	(define_insn "@nvptx_stacksave_<mode>")
	(define_insn "@nvptx_stackrestore_<mode>"): New.
	* doc/invoke.texi (Nvidia PTX Options): Update '-msoft-stack',
	'-mno-soft-stack'.
	* doc/sourcebuild.texi (nvptx-specific attributes): Document
	'nvptx_runtime_alloca_ptx'.
	(Add Options): Document 'nvptx_alloca_ptx'.

2024-12-18  Thomas Schwinge  <tschwinge@baylibre.com>

	PR target/65181
	* config/nvptx/nvptx.cc (default_ptx_version_option): For
	'-march=sm_52' and higher, default at least to '-mptx=7.3'.
	* doc/invoke.texi (Nvidia PTX Options): Update '-mptx=[...]'.

	* config/nvptx/nvptx-opts.h (enum ptx_version): Add
	'PTX_VERSION_7_3'.
	* config/nvptx/nvptx.cc (ptx_version_to_string)
	(ptx_version_to_number): Adjust.
	* config/nvptx/nvptx.h (TARGET_PTX_7_3): New.
	* config/nvptx/nvptx.opt (Enum(ptx_version)): Add 'EnumValue'
	'7.3' for 'PTX_VERSION_7_3'.
	* doc/invoke.texi (Nvidia PTX Options): Document '-mptx=7.3'.

	* doc/sourcebuild.texi (Effective-Target Keywords): Document
	'nvptx_softstack'.

	PR target/65181
	* config/nvptx/nvptx.h (STACK_SAVEAREA_MODE): '#define'.
	* config/nvptx/nvptx.md [!TARGET_SOFT_STACK]
	(save_stack_function): 'define_expand'.
	(restore_stack_function): Handle '!TARGET_SOFT_STACK'.

	PR target/65181
	* config/nvptx/nvptx.md [!TARGET_SOFT_STACK] (save_stack_block):
	'define_expand'.

	Backported from trunk:
	2024-08-09  Andrew Stubbs  <ams@baylibre.com>

	* config/gcn/gcn.cc (gcn_asm_trampoline_template): Add .align.
	* config/gcn/gcn.h (TRAMPOLINE_SIZE): Increase to 40.

	Backported from trunk:
	2024-12-09  Thomas Schwinge  <tschwinge@baylibre.com>

	* config.gcc [nvptx-*]: Switch default from '-march=sm_30' to
	'-march=sm_52'.
	* doc/install.texi (Nvidia PTX Options): Update.

	Backported from trunk:
	2024-12-09  Thomas Schwinge  <tschwinge@baylibre.com>

	* config/gcn/gcn.cc (gcn_vec_constant): Fix 'real_from_integer'
	usage.

	Backported from trunk:
	2024-12-06  Thomas Schwinge  <tschwinge@baylibre.com>

	* config/nvptx/nvptx-sm.def: Add '89'.
	* config/nvptx/nvptx-gen.h: Regenerate.
	* config/nvptx/nvptx-gen.opt: Likewise.
	* config/nvptx/nvptx.cc (first_ptx_version_supporting_sm): Adjust.
	* config/nvptx/nvptx.opt (-march-map=sm_89, -march-map=sm_90)
	(march-map=sm_90a): Likewise.
	* config.gcc: Likewise.
	* doc/invoke.texi (Nvidia PTX Options): Document '-march=sm_89'.
	* config/nvptx/gen-multilib-matches-tests: Extend.

	Backported from trunk:
	2024-12-06  Thomas Schwinge  <tschwinge@baylibre.com>

	* config/nvptx/nvptx-opts.h (enum ptx_version): Add
	'PTX_VERSION_7_8'.
	* config/nvptx/nvptx.cc (ptx_version_to_string)
	(ptx_version_to_number): Adjust.
	* config/nvptx/nvptx.h (TARGET_PTX_7_8): New.
	* config/nvptx/nvptx.opt (Enum(ptx_version)): Add 'EnumValue'
	'7.8' for 'PTX_VERSION_7_8'.
	* doc/invoke.texi (Nvidia PTX Options): Document '-mptx=7.8'.

	Backported from trunk:
	2024-12-06  Thomas Schwinge  <tschwinge@baylibre.com>

	* config/nvptx/nvptx-sm.def: Add '52'.
	* config/nvptx/nvptx-gen.h: Regenerate.
	* config/nvptx/nvptx-gen.opt: Likewise.
	* config/nvptx/nvptx.cc (first_ptx_version_supporting_sm): Adjust.
	* config/nvptx/nvptx.opt (-march-map=sm_52): Likewise.
	* config.gcc: Likewise.
	* doc/invoke.texi (Nvidia PTX Options): Document '-march=sm_52'.
	* config/nvptx/gen-multilib-matches-tests: Extend.

	Backported from trunk:
	2024-12-06  Thomas Schwinge  <tschwinge@baylibre.com>

	* config/nvptx/nvptx-sm.def: Add '37'.
	* config/nvptx/nvptx-gen.h: Regenerate.
	* config/nvptx/nvptx-gen.opt: Likewise.
	* config/nvptx/nvptx.cc (first_ptx_version_supporting_sm): Adjust.
	* config/nvptx/nvptx.opt (-march-map=sm_37, -march-map=sm_50):
	Likewise.
	* config.gcc: Likewise.
	* doc/invoke.texi (Nvidia PTX Options): Document '-march=sm_37'.
	* config/nvptx/gen-multilib-matches-tests: Extend.

	Backported from trunk:
	2024-12-06  Thomas Schwinge  <tschwinge@baylibre.com>

	* config/nvptx/nvptx-opts.h (enum ptx_version): Add
	'PTX_VERSION_4_1'.
	* config/nvptx/nvptx.cc (ptx_version_to_string)
	(ptx_version_to_number): Adjust.
	* config/nvptx/nvptx.h (TARGET_PTX_4_1): New.
	* config/nvptx/nvptx.opt (Enum(ptx_version)): Add 'EnumValue'
	'4.1' for 'PTX_VERSION_4_1'.
	* doc/invoke.texi (Nvidia PTX Options): Document '-mptx=4.1'.

	Backported from trunk:
	2024-12-06  Thomas Schwinge  <tschwinge@baylibre.com>

	* config/nvptx/nvptx.h (TARGET_PTX_4_2): New.
	* config/nvptx/nvptx.opt (Enum(ptx_version)): Add 'EnumValue'
	'4.2' for 'PTX_VERSION_4_2'.
	* doc/invoke.texi (Nvidia PTX Options): Document '-mptx=4.2'.

	Backported from trunk:
	2024-12-06  Thomas Schwinge  <tschwinge@baylibre.com>

	* config/nvptx/nvptx-opts.h (enum ptx_version): Remove
	'PTX_VERSION_3_0'.
	* config/nvptx/nvptx.cc (first_ptx_version_supporting_sm)
	(default_ptx_version_option, ptx_version_to_string)
	(ptx_version_to_number): Adjust.
	* config/nvptx/nvptx.h: Comment.

	Backported from trunk:
	2024-12-06  Thomas Schwinge  <tschwinge@baylibre.com>

	* config.gcc: nvptx: Support '--with-multilib-list'.
	* config/nvptx/gen-multilib-matches.sh: Adjust.
	* configure.ac: Likewise.
	* configure: Regenerate.
	* doc/install.texi: Update.
	* doc/invoke.texi: Align.
	* config/nvptx/gen-multilib-matches-tests: Extend.

	Backported from trunk:
	2024-12-06  Thomas Schwinge  <tschwinge@baylibre.com>

	* config/nvptx/gen-multilib-matches.sh: Support '--selftest'.
	* config/nvptx/t-nvptx (t-nvptx-gen-multilib-matches:): Invoke it.
	* config/nvptx/gen-multilib-matches-tests: New.

	Backported from trunk:
	2024-12-06  Thomas Schwinge  <tschwinge@baylibre.com>

	* config/nvptx/gen-h.sh: Don't pass in '$1'; compute it locally.
	* config/nvptx/gen-multilib-matches.sh: Likewise.
	* config/nvptx/gen-omp-device-properties.sh: Likewise.
	* config/nvptx/gen-opt.sh: Likewise.
	* config/nvptx/t-nvptx (s-nvptx-gen-h:, s-nvptx-gen-opt:)
	(t-nvptx-gen-multilib-matches:): Adjust.
	* config/nvptx/t-omp-device (omp-device-properties-nvptx):
	Likewise.

	Backported from trunk:
	2024-12-06  Thomas Schwinge  <tschwinge@baylibre.com>

	* config/nvptx/gen-multilib-matches.sh: Encapsulate main logic.

	Backported from trunk:
	2024-12-06  Thomas Schwinge  <tschwinge@baylibre.com>

	* config/nvptx/t-nvptx (multilib_matches): Don't use the 'shell'
	function of 'make'.
	* config/nvptx/gen-multilib-matches.sh: Adjust.

	Backported from trunk:
	2024-12-06  Thomas Schwinge  <tschwinge@baylibre.com>

	PR target/117916
	* config/nvptx/nvptx.opt (misa=, mptx=): Tag as 'Negative' of
	themselves.

	Backported from trunk:
	2024-09-05  Thomas Schwinge  <tschwinge@baylibre.com>

	* doc/sourcebuild.texi (Effective-Target Keywords): Document
	'nvptx_default_ptx_isa_version_at_least_6_0',
	'nvptx_runtime_alias_ptx'.
	(Add Options): Document 'nvptx_alias_ptx'.

	Backported from trunk:
	2024-09-04  Thomas Schwinge  <tschwinge@baylibre.com>

	* config/nvptx/gen-opt.sh: Use 'enum ptx_isa' instead of 'int'.
	* config/nvptx/nvptx-gen.opt: Regenerate.
	* config/nvptx/nvptx.opt: Use 'enum ptx_version' instead of 'int'.
	* config/nvptx/nvptx-opts.h (enum ptx_isa): Add 'PTX_ISA_unset'.
	(enum ptx_version): Add 'PTX_VERSION_unset'.
	* config/nvptx/nvptx-c.cc (nvptx_cpu_cpp_builtins): Adjust.
	* config/nvptx/nvptx.cc (default_ptx_version_option)
	(handle_ptx_version_option, nvptx_option_override)
	(nvptx_file_start): Likewise.

	Backported from trunk:
	2024-09-03  Tobias Burnus  <tburnus@baylibre.com>

	PR lto/116535
	* lto-cgraph.cc (output_offload_tables): Remove offload_ frees.
	* lto-streamer-out.cc (lto_output): Make call to it depend on
	lto_get_out_decl_state ()->output_offload_tables_p.
	* lto-streamer.h (struct lto_out_decl_state): Add
	output_offload_tables_p field.
	* tree-pass.h (ipa_write_optimization_summaries): Add bool argument.
	* passes.cc (ipa_write_summaries_1): Add bool
	output_offload_tables_p arg.
	(ipa_write_summaries): Update call.
	(ipa_write_optimization_summaries): Accept output_offload_tables_p.

2024-08-01  Tobias Burnus  <tburnus@baylibre.com>

	Backported from master:
	2024-08-01  Tobias Burnus  <tburnus@baylibre.com>
		    Richard Biener  <rguenther@suse.de

	PR middle-end/115637
	* gimplify.cc (gimplify_body): Fix macro name in the comment.
	* omp-offload.cc (find_link_var_op): Rename to ...
	(process_link_var_op): ... this. Replace value expr.
	(pass_omp_target_link::execute): Update walk_gimple_stmt call.

2024-07-03  Thomas Schwinge  <tschwinge@baylibre.com>

	* doc/tm.texi.in (TARGET_VECTORIZE_PREFER_GATHER_SCATTER): Remove
	documentation hook.
	* doc/tm.texi: Regenerate.
	* target.def (prefer_gather_scatter): Remove target hook under
	vectorizer.
	* tree-vect-stmts.cc (get_group_load_store_type): Remove code to
	optionally prefer gather/scatter instructions to
	scalar/elementwise fallback.
	* config/gcn/gcn.cc (TARGET_VECTORIZE_PREFER_GATHER_SCATTER):
	Remove hook definition.

2024-05-19  Roger Sayle  <roger@nextmovesoftware.com>

	* config/nvptx/nvptx.md (popcount<mode>2): Split into...
	(popcountsi2): define_insn handling SImode popcount.
	(popcountdi2): define_insn handling DImode popcount, with an
	explicit truncate:SI to produce an SImode result.

2024-04-16  Andrew Pinski  <quic_apinski@quicinc.com>

	PR middle-end/23872
	* tree-pretty-print.cc (dump_generic_node <case COMPOUND_EXPR>): Fix
	calls to dump_generic_node and also remove unreachable code that is testing
	`flags & TDF_SLIM`.

2024-06-03  Tobias Burnus  <tburnus@baylibre.com>

	* doc/install.texi (gcn): Fix date of recommended newlib version.

2024-05-10  Sandra Loosemore  <sloosemore@baylibre.com>

	* tree-nested.cc (convert_nonlocal_reference_stmt): Handle
	GIMPLE_OMP_METADIRECTIVE specially.
	(convert_local_reference_stmt): Likewise.
	(convert_tramp_reference_stmt): Likewise.
	(convert_gimple_call): Likewise.
	* gimple-pretty-print.cc (dump_gimple_omp_metadirective): Print
	variants in raw output.

2024-04-22  Sandra Loosemore  <sloosemore@baylibre.com>

	* tree-nested.cc (convert_tramp_reference_stmt): Use the correct
	accessor for GIMPLE_OMP_TARGET clauses.

2024-05-04  Sandra Loosemore  <sloosemore@baylibre.com>

	* omp-general.cc (omp_complete_construct_context): Check
	"omp declare target" attribute, not "omp declare target block".

2024-05-04  Sandra Loosemore  <sloosemore@baylibre.com>

	* cgraph.cc (symbol_table::create_edge): Don't set
	calls_declare_variant_alt in the caller.
	* cgraph.h (struct cgraph_node): Remove declare_variant_alt
	and calls_declare_variant_alt flags.
	* cgraphclones.cc (cgraph_node::create_clone): Don't copy
	calls_declare_variant_alt bit.
	* ipa-free-lang-data.cc (free_lang_data_in_decl): Adjust code
	referencing declare_variant_alt bit.
	* ipa.cc (symbol_table::remove_unreachable_nodes): Likewise.
	* lto-cgraph.cc (lto_output_node): Remove references to deleted
	bits.
	(output_refs): Adjust code referencing declare_variant_alt bit.
	(input_overwrite_node): Remove references to deleted bits.
	(input_refs): Adjust code referencing declare_variant_alt bit.
	* lto-streamer-out.cc (lto_output): Likewise.
	* lto-streamer.h (omp_lto_output_declare_variant_alt): Delete.
	(omp_lto_input_declare_variant_alt): Delete.
	* lto/lto-partition.cc (lto_balanced_map): Adjust code referencing
	deleted declare_variant_alt bit.
	* omp-expand.cc (expand_omp_target): Use has_metadirectives bit to
	trigger pass_omp_device_lower instead of calls_declare_variant_alt.
	* omp-general.cc (struct omp_declare_variant_entry): Delete.
	(struct omp_declare_variant_base_entry): Delete.
	(struct omp_declare_variant_hasher): Delete.
	(omp_declare_variant_hasher::hash): Delete.
	(omp_declare_variant_hasher::equal): Delete.
	(omp_declare_variants): Delete.
	(omp_declare_variant_alt_hasher): Delete.
	(omp_declare_variant_alt_hasher::hash): Delete.
	(omp_declare_variant_alt_hasher::equal): Delete.
	(omp_declare_variant_alt): Delete.
	(omp_lto_output_declare_variant_alt): Delete.
	(omp_lto_input_declare_variant_alt): Delete.
	(includes): Delete unnecessary include of gt-omp-general.h.
	* omp-offload.cc (execute_omp_device_lower): Remove references
	to deleted bit.
	(pass_omp_device_lower::gate): Likewise.
	* omp-simd-clone.cc (simd_clone_create): Likewise.
	* passes.cc (ipa_write_summaries): Likeise.
	* symtab.cc (symtab_node::get_partitioning_class): Likewise.
	* tree-inline.cc (expand_call_inline): Likewise.
	(tree_function_versioning): Likewise.

2024-05-04  Sandra Loosemore  <sloosemore@baylibre.com>

	* gimple-streamer-in.cc (input_gimple_stmt): Restore
	gomp_metadirective context.
	* gimple-streamer-out.cc (output_gimple_stmt): Save
	gomp_metadirective context.
	* gimple.cc (gimple_build_omp_metadirective): Initialize
	gomp_metadirective context.
	* gimple.def (GIMPLE_OMP_METADIRECTIVE): Update comments.
	* gimple.h (gomp_metadirective): Add context field and update comments.
	(gimple_omp_metadirective_context): New.
	(gimple_omp_metadirective_set_context): New.
	* gimplify.cc (omp_resolved_variant_calls): New.
	(gimplify_variant_call_expr): New.
	(gimplify_call_expr): Adjust parameters.  Call
	gimplify_variant_call_expr to handle declare variant substitution.
	(omp_construct_selector_matches): Delete.
	(omp_get_construct_context): New.
	(gimplify_omp_metadirective): Use filtered list of candidates
	to construct the gomp_metadirective structure.  Save the construct
	context.
	(gimplify_expr): Adjust arguments to gimplify_call_expr.
	(gimplify_function_tree): Initialize and free
	omp_resolved_variant_calls around the call to gimplify_body.
	* gimplify.h (omp_construct_selector_matches): Delete.
	(omp_get_construct_context): New.
	* omp-general.cc (omp_construct_traits_to_codes): Delete.
	(omp_maybe_offloaded): Add construct_context parameter and comments.
	Use construct_context to check for nesting in a target directive
	instead of calling omp_construct_selector_matches.
	(expr_uses_parm_decl): New.
	(omp_check_context_selector): Don't reject target_device selector
	for "declare variant".  Add missing check for invalid simd properties.
	Reject dynamic selectors that reference parameter variables in
	"declare variant" with a "sorry".
	(omp_construct_traits_match): New.
	(omp_context_selector_matches): Adjust parameters to pass in
	construct_context.  Rewrite construct selector matching to
	use omp_construct_traits_match.  Replace unnecessary conditionals
	checking that traits match the right selector set with asserts.
	(omp_construct_simd_compare): Add match_p parameter, use it to
	enable additional matching rules for simdlen and align clauses.
	(omp_context_selector_set_compare): Make static.  Adjust
	call to omp_construct_simd_compare).
	(omp_dynamic_cond): Clean up code missed in a previously-committed
	patch.
	(omp_context_compare_score): Adjust parameters, rewrite and add
	comments.
	(omp_complete_construct_context): New.
	(omp_resolve_late_declare_variant): Delete.
	(omp_declare_variant_remove_hook): Delete.
	(omp_resolve_declare_variant): Delete.
	(omp_get_dynamic_candidates): Make non-static and adjust parameters.
	Call omp_complete_construct_context and pass the result to
	omp_context_selector_matches.  Add more comments, debug output,
	and logic to allow resolution in some cases where candidates
	cannot be scored accurately.
	(omp_declare_variant_candidates): New.
	(omp_metadirective_candidates): New, split from...
	(omp_early_resolve_metadirective): ...here.
	(omp_late_resolve_metadirective): Explicitly initialize
	dynamic_selector field.  Adjust call to omp_get_dynamic_candidates.
	* omp-general.h (struct omp_variant): Add comments explaining
	how this is used for "declare variant".
	(omp_construct_traits_to_codes): Delete.
	(omp_context_selector_matches): Adjust parameters.
	(omp_context_selector_set_compare): Delete.
	(omp_resolve_declare_variant): Delete.
	(omp_declare_variant_candidates): Declare.
	(omp_metadirective_candidates): Declare.
	(omp_get_dynamic_candidates): Declare.
	* omp-offload.cc (execute_omp_device_lower): Remove logic
	for the old way of handling declare variant.
	* tree-inline.cc (remap_gimple_stmt): Copy metadirective context.

2024-05-04  Sandra Loosemore  <sloosemore@baylibre.com>

	* omp-general.cc (omp_check_context_selector): Reject other
	properties in the same selector set with kind(any).

2024-05-04  Sandra Loosemore  <sloosemore@baylibre.com>

	* cgraph.h (struct cgraph_node): Add has_metadirectives flag.
	* cgraphclones.cc (cgraph_node::create_clone): Copy has_metadirectives
	flag.
	* doc/gimple.texi (Class hierarchy of GIMPLE statements): Document
	gomp_metadirective and gomp_variant.
	* gimple-low.cc (lower_omp_metadirective): New.
	(lower_stmt): Call it.
	* gimple-pretty-print.cc (dump_gimple_omp_metadirective): New.
	(pp_gimple_stmt_1): Call it.
	* gimple-streamer-in.cc (input_gimple_stmt): Handle
	GIMPLE_OMP_METADIRECTIVE.
	* gimple-streamer-out.cc (output_gimple_stmt): Likewise.
	* gimple-walk.cc (walk_gimple_op): Likewise.
	(walk_gimple_stmt): Likewise.
	* gimple.cc (gimple_alloc_omp_metadirective): New.
	(gimple_build_omp_metadirective): New.
	(gimple_build_omp_variant): New.
	* gimple.def (GIMPLE_OMP_METADIRECTIVE): New.
	(GIMPLE_OMP_METADIRECTIVE_VARIANT): New.
	* gimple.h (gomp_variant, gomp_metadirective): New.
	(is_a_helper <gomp_metadirective *>::test): New.
	(is_a_helper <gomp_variant *>::test): New.
	(is_a_helper <const gomp_metadirective *>::test): New.
	(is_a_helper <const gomp_variant *>::test): New.
	(gimple_alloc_omp_metadirective): New.
	(gimple_build_omp_metadirective): New.
	(gimple_build_omp_variant): New.
	(gimple_has_substatements): Handle GIMPLE_OMP_METADIRECTIVE.
	(gimple_has_ops): Likewise.
	(gimple_omp_metadirective_label): New.
	(gimple_omp_metadirective_set_label): New.
	(gimple_omp_variants): New.
	(gimple_omp_metadirective_set_variants): New.
	(gimple_return_set_retval): Handle GIMPLE_OMP_METADIRECTIVE.
	* gimplify.cc (is_gimple_stmt): HANDLE OMP_METADIRECTIVE.
	(expand_omp_metadirective): New.
	(gimplify_omp_metadirective): New.
	(gimplify_expr): Call it.
	* gsstruct.def (GSS_OMP_METADIRECTIVE): New.
	(GSS_OMP_METADIRECTIVE_VARIANT): New.
	* lto-cgraph.cc (lto_output_node): Handle has_metadirectives flag.
	(input_overwrite_node): Likewise.
	* omp-expand.cc (expand_omp_target): Propagate has_metadirectives
	flag.
	(build_omp_regions_1): Handle GIMPLE_OMP_METADIRECTIVE.
	(omp_make_gimple_edges): Likewise.
	* omp-general.cc (omp_late_resolve_metadirective): New.
	* omp-general.h (omp_late_resolve_metadirective): Declare.
	* omp-low.cc (struct omp_context): Add next_clone field.
	(new_omp_context): Handle next_clone field.
	(clone_omp_context): New.
	(delete_omp_context): Delete clones.
	(create_omp_child_function): Propagate has_metadirectives bit.
	(scan_omp_metadirective): New.
	(scan_omp_1_stmt): Handle GIMPLE_OMP_METADIRECTIVE.
	(lower_omp_metadirective): New.
	(lower_omp_1): Handle GIMPLE_OMP_METADIRECTIVE.  Warn about
	direct calls to offloadable functions containing metadirectives.
	* omp-offload.cc: Include cfganal.h and cfghooks.h.
	(omp_expand_metadirective): New.
	(execute_omp_device_lower): Handle metadirectives.
	(pass_omp_device_lower::gate): 	Check has_metadirectives bit.
	* omp-simd-clone.cc (simd_clone_create): Propagate has_metadirectives
	flag.
	* tree-cfg.cc (cleanup_dead_labels): Handle GIMPLE_OMP_METADIRECTIVE.
	(gimple_redirect_edge_and_branch): Likewise.
	* tree-inline.cc (remap_gimple_stmt): Handle GIMPLE_OMP_METADIRECTIVE.
	(estimate_num_instructions): Likewise.
	(expand_call_inline): Propagate has_metadirectives flag.
	(tree_function_versioning): Likewise.
	* tree-ssa-operands.cc: Include omp-general.h.
	(operands_scanner::parse_ssa_operands): Handle
	GIMPLE_OMP_METADIRECTIVE.

2024-05-04  Sandra Loosemore  <sloosemore@baylibre.com>

	* Makefile.in (GTFILES): Move omp-general.h earlier in the list.
	* builtin-types.def (BT_FN_BOOL_INT_CONST_PTR_CONST_PTR_CONST_PTR):
	New.
	* doc/generic.texi (OpenMP): Document OMP_METADIRECTIVE and
	context selector interfaces.
	* omp-builtins.def (BUILT_IN_GOMP_EVALUATE_TARGET_DEVICE): New.
	* omp-general.cc (omp_check_context_selector): Add metadirective_p
	parameter, use it to conditionalize target_device support.
	(make_omp_metadirective_variant): New.
	(omp_context_selector_matches): Add metadirective_p and delay_p
	parameters, use them to control things that can only be matched
	late.  Handle OMP_TRAIT_SET_TARGET_DEVICE.
	(score_wide_int): Move definition to omp-general.h.
	(omp_encode_kind_arch_isa_props): New.
	(omp_dynamic_cond): New.
	(omp_context_compute_score): Handle OMP_TRAIT_SET_TARGET_DEVICE.
	(omp_resolve_late_declare_variant, omp_resolve_declare_variant):
	Adjust calls to omp_context_selector_matches.
	(sort_variant): New.
	(omp_get_dynamic_candidates): New.
	(omp_early_resolve_metadirective): New.
	* omp-general.h (score_wide_int): Moved here from omp-general.cc.
	(struct omp_variant): New.
	(OMP_METADIRECTIVE_VARIANT_SELECTOR): New.
	(OMP_METADIRECTIVE_VARIANT_DIRECTIVE): New.
	(OMP_METADIRECTIVE_VARIANT_BODY): New.
	(make_omp_metadirective_variant): Declare.
	(omp_check_context_selector): Adjust to match definition.
	(omp_context_selector_matches): Likewise.
	(omp_early_resolve_metadirective): New.
	* tree-pretty-print.cc (dump_omp_context_selector): Remove
	static qualifier.
	(dump_generic_node): Handle OMP_METADIRECTIVE.
	* tree-pretty-print.h (dump_omp_context_selector): Declare.
	* tree.def (OMP_METADIRECTIVE): New.
	* tree.h (OMP_METADIRECTIVE_VARIANTS): New.

2023-10-30  Tobias Burnus  <tobias@codesourcery.com>

	* gcc/gimplify.cc (gimplify_omp_allocate): Gimplify allocator.
	* omp-low.cc (lower_omp_allocate): Simplify; GOMP_free can also
	take a plain 0 as allocator argument (arg is unused in libgomp).

2023-07-14  Julian Brown  <julian@codesourcery.com>

	* omp-low.cc (lower_omp_target): Reverse iteration over array
	dimensions.

2023-07-12  Julian Brown  <julian@codesourcery.com>

	* omp-low.cc (lower_omp_target): Calculate volume enclosing
	transferred elements instead of using whole array size for
	noncontiguous 'target update' operations.

2023-07-03  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (gimplify_adjust_omp_clauses): Don't gimplify
	VIEW_CONVERT_EXPR away in GOMP_MAP_TO_GRID/GOMP_MAP_FROM_GRID clauses.
	* omp-low.cc (omp_noncontig_descriptor_type): Add SPAN field.
	(scan_sharing_clauses): Don't store descriptor size in its
	OMP_CLAUSE_SIZE field.
	(lower_omp_target): Add missing OMP_CLAUSE_MAP check.  Add special-case
	string handling.  Handle span and bias.  Use low bound instead of zero
	as index for trailing full dimensions.

2023-07-03  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (omp_group_last, omp_group_base): Add GOMP_MAP_TO_GRID,
	GOMP_MAP_FROM_GRID support.
	(gimplify_adjust_omp_clauses): Support new GOMP_MAP_GRID_DIM,
	GOMP_MAP_GRID_STRIDE mapping nodes.  Don't crash on e.g. misuse of
	ADDR_EXPR in mapping clauses.
	* omp-general.cc (omp_parse_noncontiguous_array): New function.
	(omp_parse_access_method): Add noncontiguous array support.
	(omp_parse_structure_base): Add array-shaping support.
	(debug_omp_tokenized_addr): Add ACCESS_NONCONTIG_ARRAY,
	ACCESS_NONCONTIG_REF_TO_ARRAY token support.
	* omp-general.h (access_method_kinds): Add ACCESS_NONCONTIG_ARRAY and
	ACCESS_NONCONTIG_REF_TO_ARRAY access kinds.
	* omp-low.cc (omp_noncontig_descriptor_type): New function.
	(scan_sharing_clauses): Support noncontiguous array updates.
	(lower_omp_target): Likewise.
	* tree-pretty-print.cc (dump_omp_clause): Add GOMP_MAP_TO_GRID,
	GOMP_MAP_FROM_GRID, GOMP_MAP_GRID_DIM, GOMP_MAP_GRID_STRIDE map kinds.
	(dump_generic_node): Add stride support for OMP_ARRAY_SECTION.
	* tree.def (OMP_ARRAY_SECTION): Add stride argument.

2023-06-30  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (dwarf2out.h): Include.
	(omp_maybe_get_descriptor_from_ptr): New function.
	(build_omp_struct_comp_nodes): Use above function to locate array
	descriptor when necessary.
	(omp_mapping_group_data, omp_mapping_group_ptr,
	omp_mapping_group_pset): New functions.
	(omp_instantiate_mapper): Handle inlining of "declare mapper" function
	bodies containing setup code (e.g. for Fortran).  Handle pointers to
	derived types.  Handle GOMP_MAP_MAPPING_GROUPs.
	* tree-pretty-print.cc (dump_omp_clause): Handle
	GOMP_MAP_MAPPING_GROUP.

2023-06-30  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (gimplify_omp_ctx): Add IMPLICIT_MAPPERS field.
	(new_omp_context): Initialise IMPLICIT_MAPPERS hash map.
	(delete_omp_context): Delete IMPLICIT_MAPPERS hash map.
	(instantiate_mapper_info): New structs.
	(remap_mapper_decl_1, omp_mapper_copy_decl, omp_instantiate_mapper,
	omp_instantiate_implicit_mappers): New functions.
	(gimplify_scan_omp_clauses): Handle MAPPER_BINDING clauses.
	(gimplify_adjust_omp_clauses): Instantiate implicit declared mappers.
	(gimplify_omp_declare_mapper): New function.
	(gimplify_expr): Call above function.
	* langhooks-def.h (lhd_omp_finish_mapper_clauses,
	lhd_omp_mapper_lookup, lhd_omp_extract_mapper_directive,
	lhd_omp_map_array_section): Add prototypes.
	(LANG_HOOKS_OMP_FINISH_MAPPER_CLAUSES,
	LANG_HOOKS_OMP_MAPPER_LOOKUP, LANG_HOOKS_OMP_EXTRACT_MAPPER_DIRECTIVE,
	LANG_HOOKS_OMP_MAP_ARRAY_SECTION): Define macros.
	(LANG_HOOK_DECLS): Add above macros.
	* langhooks.cc (lhd_omp_finish_mapper_clauses,
	lhd_omp_mapper_lookup, lhd_omp_extract_mapper_directive,
	lhd_omp_map_array_section): New dummy functions.
	* langhooks.h (lang_hooks_for_decls): Add OMP_FINISH_MAPPER_CLAUSES,
	OMP_MAPPER_LOOKUP, OMP_EXTRACT_MAPPER_DIRECTIVE, OMP_MAP_ARRAY_SECTION
	hooks.
	* omp-general.h (omp_name_type<T>): Add templatized struct, hash type
	traits (for omp_name_type<tree> specialization).
	(omp_mapper_list<T>): Add struct.
	* tree-core.h (omp_clause_code): Add OMP_CLAUSE__MAPPER_BINDING_.
	* tree-pretty-print.cc (dump_omp_clause): Support GOMP_MAP_UNSET,
	GOMP_MAP_PUSH_MAPPER_NAME, GOMP_MAP_POP_MAPPER_NAME artificial mapping
	clauses.  Support OMP_CLAUSE__MAPPER_BINDING_ and OMP_DECLARE_MAPPER.
	* tree.cc (omp_clause_num_ops, omp_clause_code_name): Add
	OMP_CLAUSE__MAPPER_BINDING_.
	* tree.def (OMP_DECLARE_MAPPER): New tree code.
	* tree.h (OMP_DECLARE_MAPPER_ID, OMP_DECLARE_MAPPER_DECL,
	OMP_DECLARE_MAPPER_CLAUSES): New defines.
	(OMP_CLAUSE__MAPPER_BINDING__ID, OMP_CLAUSE__MAPPER_BINDING__DECL,
	OMP_CLAUSE__MAPPER_BINDING__MAPPER): New defines.

2023-06-19  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (gimplify_adjust_omp_clauses_1): Set
	OMP_CLAUSE_MAP_RUNTIME_IMPLICIT_P for OpenACC also.

2023-06-19  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (gimplify_adjust_omp_clauses_1): Handle "oacc declare
	create" attribute.

2023-06-19  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (omp_tsort_mark, omp_mapping_group): Move before
	gimplify_omp_ctx. Add constructor to omp_mapping_group.
	(gimplify_omp_ctx): Add DECL_DATA_CLAUSE field.
	(new_omp_context, delete_omp_context): Initialise and free above field.
	(omp_gather_mapping_groups_1): Use constructor for omp_mapping_group.
	(gimplify_scan_omp_clauses): Record mappings that might be lexically
	inherited.  Don't remove
	GOMP_MAP_FIRSTPRIVATE_POINTER/GOMP_MAP_FIRSTPRIVATE_REFERENCE yet.
	(gomp_oacc_needs_data_present): New function.
	(gimplify_adjust_omp_clauses_1): Implement lexical inheritance
	behaviour for OpenACC.
	(gimplify_adjust_omp_clauses): Remove
	GOMP_MAP_FIRSTPRIVATE_POINTER/GOMP_MAP_FIRSTPRIVATE_REFERENCE here
	instead, after lexical inheritance is done.

2023-05-12  Julian Brown  <julian@codesourcery.com>

	* omp-builtins.def (BUILT_IN_OMP_IS_INITIAL_DEVICE): New builtin.
	* tree.cc (get_file_function_name): Support names for on-target
	constructor/destructor functions.

2024-06-05  Jakub Jelinek  <jakub@redhat.com>
	    Frederik Harwath  <frederik@codesourcery.com>
	    Sandra Loosemore  <sandra@codesourcery.com>

	* tree.def (OMP_TILE, OMP_UNROLL): New tree codes.
	* tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_PARTIAL,
	OMP_CLAUSE_FULL and OMP_CLAUSE_SIZES.
	* tree.h (OMP_LOOPXFORM_CHECK): Define.
	(OMP_LOOPXFORM_LOWERED): Define.
	(OMP_CLAUSE_PARTIAL_EXPR): Define.
	(OMP_CLAUSE_SIZES_LIST): Define.
	* tree.cc (omp_clause_num_ops, omp_clause_code_name): Add entries
	for OMP_CLAUSE_{PARTIAL,FULL,SIZES}.
	* tree-pretty-print.cc (dump_omp_clause): Handle
	OMP_CLAUSE_{PARTIAL,FULL,SIZES}.
	(dump_generic_node): Handle OMP_TILE and OMP_UNROLL.  Skip printing
	loops with NULL OMP_FOR_INIT (node) vector element.
	* gimplify.cc (is_gimple_stmt): Handle OMP_TILE and OMP_UNROLL.
	(gimplify_omp_taskloop_expr): For SAVE_EXPR use gimplify_save_expr.
	(gimplify_omp_loop_xform): New function.
	(gimplify_omp_for): Call omp_maybe_apply_loop_xforms and if that
	reshuffles what the passed pointer points to, retry or return GS_OK.
	Handle OMP_TILE and OMP_UNROLL.
	(gimplify_omp_loop): Call omp_maybe_apply_loop_xforms and if that
	reshuffles what the passed pointer points to, return GS_OK.
	(gimplify_expr): Handle OMP_TILE and OMP_UNROLL.
	* omp-general.h (omp_loop_number_of_iterations,
	omp_maybe_apply_loop_xforms): Declare.
	* omp-general.cc (omp_adjust_for_condition): For LE_EXPR and GE_EXPR
	with pointers, don't add/subtract one, but the size of what the
	pointer points to.
	(omp_loop_number_of_iterations, omp_apply_tile,
	find_nested_loop_xform, omp_maybe_apply_loop_xforms): New functions.

2023-03-17  Andrew Stubbs  <ams@codesourcery.com>

	* config/gcn/gcn-valu.md (gather_load<mode><vndi>): New.
	(scatter_store<mode><vndi>): New.
	(mask_gather_load<mode><vndi>): New.
	(mask_scatter_store<mode><vndi>): New.

2024-05-10  Thomas Schwinge  <tschwinge@baylibre.com>

	* config/nvptx/nvptx.md (nvptx_uniform_warp_check): Make fit for
	non-full-warp execution, via 'vote.all.pred'.
	gcc/testsuite/
	* gcc.target/nvptx/nvptx.exp
	(check_effective_target_default_ptx_isa_version_at_least_6_0):
	New.
	* gcc.target/nvptx/uniform-simt-2.c: Adjust.
	* gcc.target/nvptx/uniform-simt-5.c: New.

2024-05-28  Thomas Schwinge  <tschwinge@baylibre.com>

	* config/nvptx/nvptx.h: Configure global constructor, destructor
	support.
	gcc/testsuite/
	* gcc.dg/no_profile_instrument_function-attr-1.c: GCC/nvptx is
	'NO_DOT_IN_LABEL' but not 'NO_DOLLAR_IN_LABEL', so '$' may apper
	in identifiers.
	* lib/target-supports.exp
	(check_effective_target_global_constructor): Enable for nvptx.
	libgcc/
	* config/nvptx/crt0.c (__gbl_ctors): New weak function.
	(__main): Invoke it.
	* config/nvptx/gbl-ctors.c: New.
	* config/nvptx/t-nvptx: Configure global constructor, destructor
	support.

2022-10-24  Andrew Stubbs  <ams@codesourcery.com>

	* tree-vect-data-refs.cc (vect_analyze_data_refs): Workaround an
	address-space bug.

2023-11-19  Tobias Burnus  <tobias@codesourcery.com>
	    Chung-Lin Tang <cltang@codesourcery.com>

	* builtin-types.def (BT_FN_VOID_PTRMODE):
	(BT_FN_PTRMODE_PTRMODE_INT_PTR): Add.
	* gimplify.cc (gimplify_bind_expr): Diagnose missing
	uses_allocators clause.
	(gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses,
	gimplify_omp_workshare): Handle uses_allocators.
	* omp-builtins.def (BUILT_IN_OMP_INIT_ALLOCATOR,
	BUILT_IN_OMP_DESTROY_ALLOCATOR): Add.
	* omp-low.cc (scan_sharing_clauses):
	* tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_USES_ALLOCATORS.
	* tree.cc (omp_clause_num_ops, omp_clause_code_name): Likewise.
	* tree-pretty-print.cc (dump_omp_clause): Handle it.
	* tree.h (OMP_CLAUSE_USES_ALLOCATORS_ALLOCATOR,
	OMP_CLAUSE_USES_ALLOCATORS_MEMSPACE,
	OMP_CLAUSE_USES_ALLOCATORS_TRAITS): New.

2022-10-21  Tobias Burnus  <tobias@codesourcery.com>

	* omp-oacc-kernels-decompose.cc (top_level_omp_for_in_stmt,
	decompose_kernels_region_body): Handle GIMPLE_DEBUG like
	simple assignment.

2022-07-12  Andrew Stubbs  <ams@codesourcery.com>

	* gimple-loop-versioning.cc (loop_versioning::loop_versioning): Add
	comment.
	* omp-general.cc (omp_max_simd_vf): New function.
	* omp-general.h (omp_max_simd_vf): New prototype.
	* omp-low.cc (lower_rec_simd_input_clauses): Select largest from
	  omp_max_vf, omp_max_simt_vf, and omp_max_simd_vf.

2023-08-23  Andrew Stubbs  <ams@codesourcery.com>

	* omp-builtins.def (BUILT_IN_GOMP_ENABLE_PINNED_MODE): New.
	* omp-low.cc (omp_enable_pinned_mode): New function.
	(execute_lower_omp): Call omp_enable_pinned_mode.

2023-08-23  Andrew Stubbs  <ams@codesourcery.com>

	* common.opt: Add -foffload-memory and its enum values.
	* coretypes.h (enum offload_memory): New.
	* doc/invoke.texi: Document -foffload-memory.

2022-10-19  Tobias Burnus  <tobias@codesourcery.com>

	* omp-expand.cc (expand_omp_target): Fix OpenACC in case there
	are more than 3 arguments to the builtin function.

2022-03-01  Tobias Burnus  <tobias@codesourcery.com>

	* langhooks-def.h (lhd_omp_deep_mapping_p,
	lhd_omp_deep_mapping_cnt, lhd_omp_deep_mapping): New.
	(LANG_HOOKS_OMP_DEEP_MAPPING_P, LANG_HOOKS_OMP_DEEP_MAPPING_CNT,
	LANG_HOOKS_OMP_DEEP_MAPPING): Define.
	(LANG_HOOKS_DECLS): Use it.
	* langhooks.cc (lhd_omp_deep_mapping_p, lhd_omp_deep_mapping_cnt,
	lhd_omp_deep_mapping): New stubs.
	* langhooks.h (struct lang_hooks_for_decls): Add new hooks
	* omp-expand.cc (expand_omp_target): Handle dynamic-size
	addr/sizes/kinds arrays.
	* omp-low.cc (build_sender_ref, fixup_child_record_type,
	scan_sharing_clauses, lower_omp_target): Update to handle
	new hooks and dynamic-size addr/sizes/kinds arrays.

2021-11-16  Frederik Harwath  <frederik@codesourcery.com>

	* tree-cfg.h (gimple_debug_cfg): Change argument type from int
	to dump_flags_t.

2021-03-01  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* omp-expand.cc (expand_oacc_for): Convert .tile variable to
	diff_type before multiplying.
	* omp-general.cc (omp_extract_for_data): Use accumulated precision
	of all collapsed for-loops as precision of iteration variable, up
	to the precision of a long long.

2021-02-01  Chung-Lin Tang  <cltang@codesourcery.com>

	* omp-low.cc (install_var_field): Add new 'tree key_expr = NULL_TREE'
	default parameter. Set splay-tree lookup key to key_expr instead of
	var if key_expr is non-NULL. Adjust call to install_parm_decl.
	Update comments.
	(scan_sharing_clauses): Use clause tree expression as splay-tree key
	for map/to/from and OpenACC firstprivate cases when installing the
	variable field into the send/receive record type.
	(maybe_lookup_field_in_outer_ctx): Add code to search through
	construct clauses instead of entirely based on splay-tree lookup.
	(lower_oacc_reductions): Adjust to find map-clause of reduction
	variable, then create receiver-ref.
	(lower_omp_target): Adjust to lookup var field using clause expression.

2021-01-15  Andrew Stubbs  <ams@codesourcery.com>

	* dwarf2out.cc (add_location_or_const_value_attribute): Set
	DW_AT_address_class, if appropriate.

2021-03-04  Andrew Stubbs <ams@codesourcery.com>

	* dwarf2out.cc (notional_parents_list): New file variable.
	(gen_subprogram_die): Record offload kernel functions in
	notional_parents_list.
	(fixup_notional_parents): New function.
	(dwarf2out_finish): Call fixup_notional_parents.
	(dwarf2out_c_finalize): Reset notional_parents_list.

2021-02-26  Andrew Stubbs  <ams@codesourcery.com>

	* dwarf2out.cc (gen_subprogram_die): Replace existing low/high PC
	attributes, rather than ICE.

2021-01-16  Andrew Stubbs  <ams@codesourcery.com>

	* dwarf2out.cc (gen_subprogram_die): Check offload attributes only.

2020-12-06  Andrew Stubbs  <ams@codesourcery.com>

	* dwarf2out.cc (gen_subprogram_die): Add high/low_pc attributes for
	parents of offload kernels.

2021-01-13  Julian Brown  <julian@codesourcery.com>

	* doc/tm.texi.in (TARGET_VECTORIZE_PREFER_GATHER_SCATTER): Add
	documentation hook.
	* doc/tm.texi: Regenerate.
	* target.def (prefer_gather_scatter): Add target hook under vectorizer.
	* tree-vect-stmts.cc (get_group_load_store_type): Optionally prefer
	gather/scatter instructions to scalar/elementwise fallback.
	* config/gcn/gcn.cc (TARGET_VECTORIZE_PREFER_GATHER_SCATTER): Define
	hook.

2021-01-13  Julian Brown  <julian@codesourcery.com>

	* omp-offload.cc (oacc_thread_numbers): Add VF_BY_VECTORIZER parameter.
	Add overloaded wrapper for previous arguments & behaviour.
	(oacc_xform_loop): Lower vector loops to iterate a multiple of
	omp_max_vf times over contiguous steps on non-SIMT targets.

2020-06-03  Tobias Burnus  <tobias@codesourcery.com>

	* gimplify.cc (localize_reductions): Do not create local
	variable for privatized arrays.

2020-02-06  Tobias Burnus  <tobias@codesourcery.com>

	* omp-low.c (convert_from_firstprivate_int):
	Use VIEW_CONVERT also for vectors.

2023-04-17  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* gimplify.cc (omp_group_base): Handle GOMP_MAP_DECLARE_ALLOCATE
	and GOMP_MAP_DECLARE_DEALLOCATE.

2020-02-19  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (gimplify_scan_omp_clauses): Handle
	GOMP_MAP_DECLARE_ALLOCATE and GOMP_MAP_DECLARE_DEALLOCATE.

2018-10-04  Cesar Philippidis  <cesar@codesourcery.com>
	    Julian Brown  <julian@codesourcery.com>

	* omp-low.c (scan_sharing_clauses): Update handling of OpenACC declare
	create, declare copyin and declare deviceptr to have local lifetimes.
	(convert_to_firstprivate_int): Handle pointer types.
	(convert_from_firstprivate_int): Likewise.  Create local storage for
	the values being pointed to.  Add new orig_type argument.
	(lower_omp_target): Handle GOMP_MAP_DECLARE_{ALLOCATE,DEALLOCATE}.
	Add orig_type argument to convert_from_firstprivate_int call.
	Allow pointer types with GOMP_MAP_FIRSTPRIVATE_INT.  Don't privatize
	firstprivate VLAs.
	* tree-pretty-print.c (dump_omp_clause): Handle
	GOMP_MAP_DECLARE_{ALLOCATE,DEALLOCATE}.

2019-09-20  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (localize_reductions): Rewrite references for
	OMP_CLAUSE_PRIVATE also.

2019-09-06  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (gimplify_omp_for): Use for_stmt in call to
	localize_reductions.

2019-09-06  Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (gimplify_omp_workshare): Use OMP_CLAUSES, OMP_BODY
	instead of OMP_TARGET_CLAUSES, OMP_TARGET_BODY.

2019-09-05  Cesar Philippidis  <cesar@codesourcery.com>
	    Julian Brown  <julian@codesourcery.com>

	* gimplify.cc (privatize_reduction): New struct.
	(localize_reductions_r, localize_reductions): New functions.
	(gimplify_omp_for): Call localize_reductions.
	(gimplify_omp_workshare): Likewise.
	* omp-low.cc (lower_oacc_reductions): Handle localized reductions.
	Create fewer temp vars.
	* tree-core.h (omp_clause_code): Add OMP_CLAUSE_REDUCTION_PRIVATE_DECL
	documentation.
	* tree.cc (omp_clause_num_ops): Bump number of ops for
	OMP_CLAUSE_REDUCTION to 6.
	(walk_tree_1): Adjust accordingly.
	* tree.h (OMP_CLAUSE_REDUCTION_PRIVATE_DECL): Add macro.

2019-07-10  Cesar Philippidis  <cesar@codesourcery.com>
	    Chung-Lin Tang  <cltang@codesourcery.com>

	* gimplify.cc (omp_add_variable): Enable firstprivate reduction
	variables.

2018-09-20  Cesar Philippidis  <cesar@codesourcery.com>

	* omp-low.cc (lower_oacc_head_mark): Don't mark OpenACC auto
	loops as independent inside acc parallel regions.

2018-12-22  Cesar Philippidis  <cesar@codesourcery.com>
            Julian Brown  <julian@codesourcery.com>
            Tobias Burnus  <tobias@codesourcery.com>

	* omp-low.cc (maybe_lookup_field_in_outer_ctx): New function.
	(convert_to_firstprivate_int): New function.
	(convert_from_firstprivate_int): New function.
	(lower_omp_target): Enable GOMP_MAP_FIRSTPRIVATE_INT in OpenACC.
	Remove unused variable.

2018-10-05  Nathan Sidwell  <nathan@acm.org>
	    Tom de Vries  <tdevries@suse.de>
	    Thomas Schwinge  <thomas@codesourcery.com>
	    Julian Brown  <julian@codesourcery.com>

	* doc/invoke.texi (fopenacc-dim): Update.
	* omp-offload.cc (oacc_parse_default_dims): Update.

2018-10-30  Cesar Philippidis  <cesar@codesourcery.com>

	* config/nvptx/nvptx.cc (nvptx_propagate_unified): New.
	(nvptx_split_blocks): Call it for cond_uni insn.
	(nvptx_expand_cond_uni): New.
	(enum nvptx_builtins): Add NVPTX_BUILTIN_COND_UNI.
	(nvptx_init_builtins): Initialize it.
	(nvptx_expand_builtin):
	(nvptx_generate_vector_shuffle): Change integral SHIFT operand to
	tree BITS operand.
	(nvptx_vector_reduction): New.
	(nvptx_adjust_reduction_type): New.
	(nvptx_goacc_reduction_setup): Use it to adjust the type of ref_to_res.
	(nvptx_goacc_reduction_init): Don't update LHS if it doesn't exist.
	(nvptx_goacc_reduction_fini): Call nvptx_vector_reduction for vector.
	Use it to adjust the type of ref_to_res.
	(nvptx_goacc_reduction_teardown):
	* config/nvptx/nvptx.md (cond_uni): New pattern.

2018-06-29  Cesar Philippidis  <cesar@codesourcery.com>
	    James Norris  <jnorris@codesourcery.com>

	* gimplify.cc (enum gimplify_omp_var_data): Add GOVD_DEVICETPR.
	(omp_notice_variable): Add GOVD_DEVICEPTR attribute when appropriate.
	(gimplify_scan_omp_clauses): Add GOVD_DEVICEPTR attribute when
	appropriate.
	(gimplify_adjust_omp_clauses_1): Set GOMP_MAP_FORCE_DEVICEPTR for
	implicit deviceptr mappings.

2023-04-18  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* gimplify.cc (omp_group_base): Handle GOMP_MAP_NONCONTIG_ARRAY_*
	map types.

2020-04-19  Chung-Lin Tang  <cltang@codesourcery.com>

	PR other/76739

	* builtin-types.def (BT_FN_VOID_INT_SIZE_PTR_PTR_PTR_VAR): New type.
	* omp-builtins.def (BUILT_IN_GOACC_DATA_START): Adjust function type
	to new BT_FN_VOID_INT_SIZE_PTR_PTR_PTR_VAR.
	* gimplify.cc (gimplify_scan_omp_clauses): Skip gimplification of
	OMP_CLAUSE_SIZE of non-contiguous array maps (which is a TREE_LIST).
	* omp-expand.cc (expand_omp_target): Add non-contiguous array descriptor
	pointers to variadic arguments.
	* omp-low.cc (append_field_to_record_type): New function.
	(create_noncontig_array_descr_type): Likewise.
	(create_noncontig_array_descr_init_code): Likewise.
	(scan_sharing_clauses): For non-contiguous array map kinds, check for
	supported dimension structure, and install non-contiguous array
	variable into current omp_context.
	(reorder_noncontig_array_clauses): New function.
	(scan_omp_target): Call reorder_noncontig_array_clauses to place
	non-contiguous array map clauses at beginning of clause sequence.
	(lower_omp_target): Add handling for non-contiguous array map kinds,
	add all created non-contiguous array descriptors to
	gimple_omp_target_data_arg.

2022-06-20  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* Makefile.in (REVISION_s): Change default message.