aboutsummaryrefslogtreecommitdiff
path: root/gcc/ChangeLog.omp
blob: e260341d53aaa45888c277878cdad7b28543f40a (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
1725
1726
1727
1728
1729
1730
2022-04-20  Andrew Stubbs  <ams@codesourcery.com>

	* omp-low.c: Do USM transformations for "unified_address".

2022-04-02  Andrew Stubbs  <ams@codesourcery.com>

	* omp-low.c (usm_transform): Transform omp_target_alloc and
	omp_target_free.

2022-03-31  Abid Qadeer  <abidh@codesourcery.com>

	* omp-low.c (lower_omp_allocate): Move allocate declaration
	inside loop.  Set it to false at the end of condition.

2022-03-30  Andrew Stubbs  <ams@codesourcery.com>

	* omp-builtins.def (BUILT_IN_GOMP_ENABLE_PINNED_MODE): New.
	* omp-low.c (omp_enable_pinned_mode): Use
	BUILT_IN_GOMP_ENABLE_PINNED_MODE.

2022-03-11  Andrew Stubbs <ams@codesourcery.com>

	Backport of the patch posted at
	https://gcc.gnu.org/pipermail/gcc-patches/2022-March/591354.html

	* omp-low.c (omp_enable_pinned_mode): New function.
	(execute_lower_omp): Call omp_enable_pinned_mode.

2022-03-11  Abid Qadeer  <abidh@codesourcery.com>

	Backport of a patch posted at
	https://gcc.gnu.org/pipermail/gcc-patches/2022-March/591353.html

	* omp-low.c (usm_transform): New function.
	(make_pass_usm_transform): Likewise.
	(class pass_usm_transform): New.
	* passes.def: Add pass_usm_transform.
	* tree-pass.h (make_pass_usm_transform): New declaration.

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

	Backport of the patch posted at
	https://gcc.gnu.org/pipermail/gcc-patches/2022-March/591350.html

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

2022-03-10  Abid Qadeer  <abidh@codesourcery.com>

	* tree.c (walk_tree_1): Add case for OMP_CLAUSE_ALLOCATOR.

2022-03-09  Abid Qadeer  <abidh@codesourcery.com>

	Backport of a patch posted at
	https://gcc.gnu.org/pipermail/gcc-patches/2022-January/588372.html

	* omp-low.c (scan_sharing_clauses): Handle OMP_CLAUSE_ALLOCATOR.
	(scan_omp_allocate): New.
	(scan_omp_1_stmt): Call it.
	(lower_omp_allocate): New function.
	(lower_omp_1): Call it.

2022-03-09  Abid Qadeer  <abidh@codesourcery.com>

	Backport of a patch posted at
	https://gcc.gnu.org/pipermail/gcc-patches/2022-January/588371.html

	* doc/gimple.texi: Describe GIMPLE_OMP_ALLOCATE.
	* gimple-pretty-print.c (dump_gimple_omp_allocate): New function.
	(pp_gimple_stmt_1): Call it.
	* gimple.c (gimple_build_omp_allocate): New function.
	* gimple.def (GIMPLE_OMP_ALLOCATE): New node.
	* gimple.h (enum gf_mask): Add GF_OMP_ALLOCATE_KIND_MASK,
	GF_OMP_ALLOCATE_KIND_ALLOCATE and GF_OMP_ALLOCATE_KIND_FREE.
	(struct gomp_allocate): New.
	(is_a_helper <gomp_allocate *>::test): New.
	(is_a_helper <const gomp_allocate *>::test): New.
	(gimple_build_omp_allocate): Declare.
	(gimple_omp_subcode): Replace GIMPLE_OMP_TEAMS with
	GIMPLE_OMP_ALLOCATE.
	(gimple_omp_allocate_set_clauses): New.
	(gimple_omp_allocate_set_kind): Likewise.
	(gimple_omp_allocate_clauses): Likewise.
	(gimple_omp_allocate_kind): Likewise.
	(CASE_GIMPLE_OMP): Add GIMPLE_OMP_ALLOCATE.
	* gimplify.c (gimplify_omp_allocate): New.
	(gimplify_expr): Call it.
	* gsstruct.def (GSS_OMP_ALLOCATE): Define.

2022-03-09  Abid Qadeer  <abidh@codesourcery.com>

	Backport of a patch posted at
	https://gcc.gnu.org/pipermail/gcc-patches/2022-January/588370.html

	* tree-core.h (struct tree_base): Add comments.
	* tree-pretty-print.c (dump_generic_node): Handle allocate directive
	kind.
	* tree.h (OMP_ALLOCATE_KIND_ALLOCATE): New define.
	(OMP_ALLOCATE_KIND_FREE): Likewise.

2022-03-09  Abid Qadeer  <abidh@codesourcery.com>

	Backport of a patch posted at
	https://gcc.gnu.org/pipermail/gcc-patches/2022-January/588369.html

	* tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE_ALLOCATOR.
	(dump_generic_node): Handle OMP_ALLOCATE.
	* tree.def (OMP_ALLOCATE): New.
	* tree.h (OMP_ALLOCATE_CLAUSES): Likewise.
	(OMP_ALLOCATE_DECL): Likewise.
	(OMP_ALLOCATE_ALLOCATOR): Likewise.
	* tree.c (omp_clause_num_ops): Add entry for OMP_CLAUSE_ALLOCATOR.

2022-03-08  Abid Qadeer  <abidh@codesourcery.com>

	* omp-low.c (omp_maybe_offloaded_ctx): New prototype.
	(scan_sharing_clauses):  Check a restriction on allocate clause.

2022-02-27  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-11-15  Jakub Jelinek  <jakub@redhat.com>

	* gimplify.c (optimize_target_teams): Only add OMP_CLAUSE_THREAD_LIMIT
	to OMP_TARGET_CLAUSES if it isn't there already.

2022-02-27  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-11-11  Jakub Jelinek  <jakub@redhat.com>

	* tree.h (OMP_CLAUSE_NUM_TEAMS_EXPR): Rename to ...
	(OMP_CLAUSE_NUM_TEAMS_UPPER_EXPR): ... this.
	(OMP_CLAUSE_NUM_TEAMS_LOWER_EXPR): Define.
	* tree.c (omp_clause_num_ops): Increase num ops for
	OMP_CLAUSE_NUM_TEAMS to 2.
	* tree-pretty-print.c (dump_omp_clause): Print optional lower bound
	for OMP_CLAUSE_NUM_TEAMS.
	* gimplify.c (gimplify_scan_omp_clauses): Gimplify
	OMP_CLAUSE_NUM_TEAMS_LOWER_EXPR if non-NULL.
	(optimize_target_teams): Use OMP_CLAUSE_NUM_TEAMS_UPPER_EXPR instead
	of OMP_CLAUSE_NUM_TEAMS_EXPR.  Handle OMP_CLAUSE_NUM_TEAMS_LOWER_EXPR.
	* omp-low.c (lower_omp_teams): Use OMP_CLAUSE_NUM_TEAMS_UPPER_EXPR
	instead of OMP_CLAUSE_NUM_TEAMS_EXPR.
	* omp-expand.c (expand_teams_call, get_target_arguments): Likewise.

2022-02-27  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-10-30  Tobias Burnus  <tobias@codesourcery.com>

	PR middle-end/102972
	* omp-low.c (omp_runtime_api_call): Use DECL_ASSEMBLER_NAME to get
	internal Fortran name; new permit_num_teams arg to permit
	omp_get_num_teams and omp_get_team_num.
	(scan_omp_1_stmt): Update call to it, add missing call for
	reverse offload, and check for strictly nested API calls in teams.

2022-02-11  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* omp-general.c (DELAY_METADIRECTIVES_AFTER_LTO): Check that cfun is
	non-null before derefencing.

2022-01-28  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* gimplify.c (gimplify_omp_metadirective): Mark offloadable functions
	containing metadirectives with 'construct={target}' in the selector.
	* omp-general.c (omp_has_target_constructor_p): New.
	* omp-general.h (omp_has_target_constructor_p): New prototype.
	* omp-low.c (lower_omp_1): Emit warning if marked functions called
	outside of a target context.

2022-01-25  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* builtin-types.def (BT_FN_BOOL_INT_CONST_PTR_CONST_PTR_CONST_PTR): New
	type.
	* omp-builtins.def (BUILT_IN_GOMP_EVALUATE_TARGET_DEVICE): New builtin.
	* omp-general.c (omp_context_selector_matches): Handle 'target_device'
	selector set.
	(omp_dynamic_cond): Generate expression tree for 'target_device'
	selector set.
	(omp_context_compute_score): Handle selectors in 'target_device' set.

2022-01-25  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* omp-general.c (omp_dynamic_cond): Do not return user condition if
	constant.

2022-01-25  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* omp-general.c (omp_check_context_selector): Revert string length
	check.
	(omp_context_name_list_prop): Likewise.

2022-01-25  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* Makefile.in (OBJS): Add omp-expand-metadirective.o.
	* gimple-streamer-in.c (input_gimple_stmt): Add case for
	GIMPLE_OMP_METADIRECTIVE.  Handle metadirective labels.
	* gimple-streamer-out.c (output_gimple_stmt): Likewise.
	* omp-expand-metadirective.cc: New.
	* passes.def: Add pass_omp_expand_metadirective.
	* tree-pass.h (make_pass_omp_expand_metadirective): New prototype.

2022-01-25  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* gimplify.c (expand_omp_metadirective): New.
	* omp-general.c: Include tree-pretty-print.h.
	(DELAY_METADIRECTIVES_AFTER_LTO): New macro.
	(omp_context_selector_matches): Delay resolution of selectors.  Allow
	non-constant expressions.
	(omp_dynamic_cond): New.
	(omp_dynamic_selector_p): New.
	(sort_variant): New.
	(omp_get_dynamic_candidates): New.
	(omp_resolve_metadirective): New.
	(omp_resolve_metadirective): New.
	* omp-general.h (struct omp_metadirective_variant): New.
	(omp_resolve_metadirective): New prototype.

2022-01-25  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* gimple-low.c (lower_omp_metadirective): New.
	(lower_stmt): Handle GIMPLE_OMP_METADIRECTIVE.
	* gimple-pretty-print.c (dump_gimple_omp_metadirective): New.
	(pp_gimple_stmt_1): Handle GIMPLE_OMP_METADIRECTIVE.
	* gimple-walk.c (walk_gimple_op): Handle GIMPLE_OMP_METADIRECTIVE.
	(walk_gimple_stmt): Likewise.
	* gimple.c (gimple_alloc_omp_metadirective): New.
	(gimple_build_omp_metadirective): New.
	(gimple_build_omp_metadirective_variant): New.
	* gimple.def (GIMPLE_OMP_METADIRECTIVE): New.
	(GIMPLE_OMP_METADIRECTIVE_VARIANT): New.
	* gimple.h (gomp_metadirective_variant): New.
	(gomp_metadirective): New.
	(is_a_helper <gomp_metadirective *>::test): New.
	(is_a_helper <gomp_metadirective_variant *>::test): New.
	(is_a_helper <const gomp_metadirective *>::test): New.
	(is_a_helper <const gomp_metadirective_variant *>::test): New.
	(gimple_alloc_omp_metadirective): New prototype.
	(gimple_build_omp_metadirective): New prototype.
	(gimple_build_omp_metadirective_variant): New prototype.
	(gimple_has_substatements): Add GIMPLE_OMP_METADIRECTIVE case.
	(gimple_has_ops): Add GIMPLE_OMP_METADIRECTIVE.
	(gimple_omp_metadirective_label): New.
	(gimple_omp_metadirective_set_label): New.
	(gimple_omp_metadirective_variants): New.
	(gimple_omp_metadirective_set_variants): New.
	(CASE_GIMPLE_OMP): Add GIMPLE_OMP_METADIRECTIVE.
	* gimplify.c (is_gimple_stmt): Add OMP_METADIRECTIVE.
	(expand_omp_metadirective): New.
	(gimplify_omp_metadirective): New.
	(gimplify_expr): Add case for OMP_METADIRECTIVE.
	* gsstruct.def (GSS_OMP_METADIRECTIVE): New.
	(GSS_OMP_METADIRECTIVE_VARIANT): New.
	* omp-expand.c (build_omp_regions_1): Handle GIMPLE_OMP_METADIRECTIVE.
	(omp_make_gimple_edges): Likewise.
	* omp-low.c (struct omp_context): Add next_clone field.
	(new_omp_context): Initialize next_clone field.
	(clone_omp_context): New.
	(delete_omp_context): Delete clone contexts.
	(scan_omp_metadirective): New.
	(scan_omp_1_stmt): Handle GIMPLE_OMP_METADIRECTIVE.
	(lower_omp_metadirective): New.
	(lower_omp_1): Handle GIMPLE_OMP_METADIRECTIVE.
	* tree-cfg.c (cleanup_dead_labels): Handle GIMPLE_OMP_METADIRECTIVE.
	(gimple_redirect_edge_and_branch): Likewise.
	* tree-inline.c (remap_gimple_stmt): Handle GIMPLE_OMP_METADIRECTIVE.
	(estimate_num_insns): Likewise.
	* tree-pretty-print.c (dump_generic_node): Handle OMP_METADIRECTIVE.
	* tree-ssa-operands.c (parse_ssa_operands): Handle
	GIMPLE_OMP_METADIRECTIVE.

2022-01-25  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* omp-general.c (omp_context_selector_matches): Add extra argument.
	(omp_resolve_metadirective): New stub function.
	* omp-general.h (struct omp_metadirective_variant): New.
	(omp_context_selector_matches): Add extra argument.
	(omp_resolve_metadirective): New prototype.
	* tree.def (OMP_METADIRECTIVE): New.
	* tree.h (OMP_METADIRECTIVE_CLAUSES): New macro.

2022-01-25  Kwok Cheung Yeung  <kcy@codesourcery.com>

	Backport from master:
	2021-06-10  Richard Biener  <rguenther@suse.de>

	* system.h (gcc_stablesort_r): Declare.
	* sort.cc (gcc_sort_r): Support stable sort.
	(gcc_stablesort_r): Define.
	* vec.h (vec<>::stablesort): Add.

2022-01-19  Marcel Vollweiler  <marcel@codesourcery.com>

	Backport from master:
	* config/gcn/icv-device.c: Make GOMP_DEVICE_NUM_VAR public (remove
	"static") to make the device num available in the offload image.

2021-12-22  Andrew Stubbs  <ams@codesourcery.com>

	Backport from master:
	* config/gcn/mkoffload.c (process_asm): Process the variable table
	completely differently.
	(process_obj): Encode the varaible data differently.

2021-12-22  Andrew Stubbs  <ams@codesourcery.com>

	* config/nvptx/nvptx-opts.h (ptx_version): Change PTX_VERSION_3_1 to
	PTX_VERSION_4_1.
	* config/nvptx/nvptx.c (nvptx_file_start): Bump minimum PTX version
	to 4.1.
	* config/nvptx/nvptx.opt (ptx_version): Add 4.1. Change default.
	doc/invoke.texi: -mptx default is now 4.1.

2021-11-02  Tobias Burnus  <tobias@codesourcery.com>

	Backport from master:
	2021-10-30  Jakub Jelinek  <jakub@redhat.com>

	* gimplify.c (gimplify_omp_for): Diagnose threadprivate iterators.

2021-10-27  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-10-27  Jakub Jelinek  <jakub@redhat.com>

	* omp-expand.c (expand_omp_for_init_counts): Handle non-rectangular
	iterators with pointer types.
	(expand_omp_for_init_vars, extract_omp_for_update_vars): Likewise.

2021-10-15  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-10-14  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* omp-general.c (omp_check_context_selector):  Move from c-omp.c.
	(omp_mark_declare_variant): Move from c-omp.c.
	(omp_context_name_list_prop): Update for Fortran strings.
	* omp-general.h (omp_check_context_selector): New prototype.
	(omp_mark_declare_variant): New prototype.

2021-10-12  Julian Brown  <julian@codesourcery.com>

	Revert:

	2019-09-10  Chung-Lin Tang  <cltang@codesourcery.com>

	* config/nvptx/nvptx.c (nvptx_expand_to_rtl_hook): New function
	implementing CUDA .params space transformation.
	(TARGET_EXPAND_TO_RTL_HOOK): implement hook with
	nvptx_expand_to_rtl_hook.

2021-10-12  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-10-12  Jakub Jelinek  <jakub@redhat.com>

	* gimple-fold.h (clear_padding_type_may_have_padding_p): Declare.
	* gimple-fold.c (clear_padding_type_may_have_padding_p): No longer
	static.

2021-10-11  Marcel Vollweiler  <marcel@codesourcery.com>

	Backported from master:
	2021-10-11  Marcel Vollweiler  <marcel@codesourcery.com>

	* allocator.c (omp_init_allocator): Replace omp_atv_sequential with
	omp_atv_serialized.
	* omp.h.in: Add deprecated flag for omp_atv_sequential.
	* omp_lib.f90.in: Add deprecated flag for omp_atv_sequential.
	* testsuite/libgomp.c-c++-common/alloc-10.c: New test.
	* testsuite/libgomp.fortran/alloc-12.f90: New test.

2021-10-11  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-10-11  Jakub Jelinek  <jakub@redhat.com>

	* omp-low.c (omp_runtime_api_call): Handle omp_get_max_teams,
	omp_[sg]et_teams_thread_limit and omp_set_num_teams.

2021-10-01  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-10-01  Jakub Jelinek  <jakub@redhat.com>

	* tree.h (OMP_CLAUSE_ORDER_REPRODUCIBLE): Define.
	* tree-pretty-print.c (dump_omp_clause) <case OMP_CLAUSE_ORDER>: Print
	reproducible: for OMP_CLAUSE_ORDER_REPRODUCIBLE.
	* omp-general.c (omp_extract_for_data): If OMP_CLAUSE_ORDER is seen
	without OMP_CLAUSE_ORDER_UNCONSTRAINED, overwrite sched_kind to
	OMP_CLAUSE_SCHEDULE_STATIC.

2021-09-30  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-09-30  Tobias Burnus  <tobias@codesourcery.com>

	* omp-low.c (omp_runtime_api_call): Add omp_aligned_{,c}alloc and
	omp_{c,re}alloc, fix omp_alloc/omp_free.

2021-09-29  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-09-29  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/102504
	* gimplify.c (gimplify_scan_omp_clauses): Use omp_check_private even
	in OMP_SCOPE clauses, not just on worksharing construct clauses.

2021-09-28  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-09-28  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/102492
	* gimplify.c (gimplify_adjust_omp_clauses_1): Don't call the
	omp_finish_clause langhook on implicitly added OMP_CLAUSE_PRIVATE
	clauses on SIMD constructs.
	* g++.dg/gomp/simd-3.C: New test.

2021-09-24  Marcel Vollweiler  <marcel@codesourcery.com>

	This patch removes the expectation that 'requires reverse_offload' is
	unsupported from some 'target device ancester' tests which were introduced in
	commit 03be3cfeef7b3811acb6c4a8da2fc5c1e25d3e4c. This is necessary since
	commit f5bfc65f9a6e1f69b17d3740d043d2fbda339e05 changed the behaviour for
	reverse_offload.

	* c-c++-common/gomp/target-device-ancestor-2.c: Remove message for unsupported
	reverse offload.
	* c-c++-common/gomp/target-device-ancestor-3.c: Likewise.
	* c-c++-common/gomp/target-device-ancestor-4.c: Likewise.

2021-09-22  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-09-22  Tobias Burnus  <tobias@codesourcery.com>

	PR fortran/55534
	* doc/invoke.texi (-Wno-missing-include-dirs.): Document Fortran
	behavior.

2021-09-22  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-09-22  Tobias Burnus  <tobias@codesourcery.com>

	* trans-expr.c (gfc_simple_for_loop): New.
	* trans.h (gfc_simple_for_loop): New prototype.

2021-09-22  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-09-22  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/102415
	* omp-expand.c (expand_omp_single): If region->exit is NULL,
	assert region->entry is GIMPLE_OMP_SCOPE region and return.

2021-09-22  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-09-22  Jakub Jelinek  <jakub@redhat.com>

	* tree.h (OMP_CLAUSE_ALLOCATE_ALIGN): Define.
	* tree.c (omp_clause_num_ops): Change number of OMP_CLAUSE_ALLOCATE
	arguments from 2 to 3.
	* tree-pretty-print.c (dump_omp_clause): Print allocator() around
	allocate clause allocator and print align if present.
	* omp-low.c (scan_sharing_clauses): Force allocate_map entry even
	for omp_default_mem_alloc if align modifier is present.  If align
	modifier is present, use TREE_LIST to encode both allocator and
	align.
	(lower_private_allocate, lower_rec_input_clauses, create_task_copyfn):
	Handle align modifier on allocator clause if present.

2021-09-20  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-09-18  Jakub Jelinek  <jakub@redhat.com>

	* tree.h (OMP_CLAUSE_ORDER_UNCONSTRAINED): Define.
	* tree-pretty-print.c (dump_omp_clause): Print unconstrained:
	for OMP_CLAUSE_ORDER_UNCONSTRAINED.

2021-09-20  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-09-18  Jakub Jelinek  <jakub@redhat.com>

	* gimplify.c (omp_default_clause): For C/C++ default({,first}private),
	if file/namespace scope variable doesn't have predetermined sharing,
	treat it as if there was default(none).

2021-09-14  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-09-14  Jakub Jelinek  <jakub@redhat.com>

	* gimplify.c (goa_stabilize_expr): Add depth argument, propagate
	it to recursive calls, for depth above 7 just gimplify or return.
	Perform a test even for MODIFY_EXPR, ADDR_EXPR, COMPOUND_EXPR with
	__builtin_clear_padding and TARGET_EXPR.
	(gimplify_omp_atomic): Adjust goa_stabilize_expr callers.

2021-09-13  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-09-10  Jakub Jelinek  <jakub@redhat.com>

	* tree-core.h (enum omp_memory_order): Add OMP_MEMORY_ORDER_MASK,
	OMP_FAIL_MEMORY_ORDER_UNSPECIFIED, OMP_FAIL_MEMORY_ORDER_RELAXED,
	OMP_FAIL_MEMORY_ORDER_ACQUIRE, OMP_FAIL_MEMORY_ORDER_RELEASE,
	OMP_FAIL_MEMORY_ORDER_ACQ_REL, OMP_FAIL_MEMORY_ORDER_SEQ_CST and
	OMP_FAIL_MEMORY_ORDER_MASK enumerators.
	(OMP_FAIL_MEMORY_ORDER_SHIFT): Define.
	* gimple-pretty-print.c (dump_gimple_omp_atomic_load,
	dump_gimple_omp_atomic_store): Print [weak] for weak atomic
	load/store.
	* gimple.h (enum gf_mask): Change GF_OMP_ATOMIC_MEMORY_ORDER
	to 6-bit mask, adjust GF_OMP_ATOMIC_NEED_VALUE value and add
	GF_OMP_ATOMIC_WEAK.
	(gimple_omp_atomic_weak_p, gimple_omp_atomic_set_weak): New inline
	functions.
	* tree.h (OMP_ATOMIC_WEAK): Define.
	* tree-pretty-print.c (dump_omp_atomic_memory_order): Adjust for
	fail memory order being encoded in the same enum and also print
	fail clause if present.
	(dump_generic_node): Print weak clause if OMP_ATOMIC_WEAK.
	* gimplify.c (goa_stabilize_expr): Add target_expr and rhs arguments,
	handle pre_p == NULL case as a test mode that only returns value
	but doesn't change gimplify nor change anything otherwise, adjust
	recursive calls, add MODIFY_EXPR, ADDR_EXPR, COND_EXPR, TARGET_EXPR
	and CALL_EXPR handling, adjust COMPOUND_EXPR handling for
	__builtin_clear_padding calls, for !rhs gimplify as lvalue rather
	than rvalue.
	(gimplify_omp_atomic): Adjust goa_stabilize_expr caller.  Handle
	COND_EXPR rhs.  Set weak flag on gimple load/store for
	OMP_ATOMIC_WEAK.
	* omp-expand.c (omp_memory_order_to_fail_memmodel): New function.
	(omp_memory_order_to_memmodel): Adjust for fail clause encoded
	in the same enum.
	(expand_omp_atomic_cas): New function.
	(expand_omp_atomic_pipeline): Use omp_memory_order_to_fail_memmodel
	function.
	(expand_omp_atomic): Attempt to optimize atomic compare and exchange
	using expand_omp_atomic_cas.

2021-09-13  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-09-06  Tobias Burnus  <tobias@codesourcery.com>

	* doc/invoke.texi (-foffload-options): Fix @opindex.

2021-09-07  Marcel Vollweiler  <marcel@codesourcery.com>

	Backported from master:
	2021-09-07  Marcel Vollweiler  <marcel@codesourcery.com>

	* c-omp.c (c_finish_omp_flush): Handle MEMMODEL_SEQ_CST.
	* c-parser.c (c_parser_omp_flush): Parse 'seq_cst' clause on 'flush'
	directive.
	* parser.c (cp_parser_omp_flush): Parse 'seq_cst' clause on 'flush'
	directive.
	* semantics.c (finish_omp_flush): Handle MEMMODEL_SEQ_CST.
	* openmp.c (gfc_match_omp_flush): Parse 'seq_cst' clause on 'flush'
	directive.
	* trans-openmp.c (gfc_trans_omp_flush): Handle OMP_MEMORDER_SEQ_CST.
	* c-c++-common/gomp/flush-1.c: Add test case for 'seq_cst'.
	* c-c++-common/gomp/flush-2.c: Add test case for 'seq_cst'.
	* g++.dg/gomp/attrs-1.C: Adapt test to handle all flush clauses.
	* g++.dg/gomp/attrs-2.C: Adapt test to handle all flush clauses.
	* gfortran.dg/gomp/flush-1.f90: Add test case for 'seq_cst'.
	* gfortran.dg/gomp/flush-2.f90: Add test case for 'seq_cst'.

2021-09-03  Tobias Burnus  <tobias@codesourcery.com>

	2021-09-03  Jakub Jelinek  <jakub@redhat.com>

	* omp-expand.c (expand_omp_atomic_pipeline): Use
	IFN_ATOMIC_COMPARE_EXCHANGE instead of
	BUILT_IN_SYNC_VAL_COMPARE_AND_SWAP_? so that memory order
	can be provided.

2021-09-02  Marcel Vollweiler  <marcel@codesourcery.com>

	Backported from master:
	2021-09-02  Marcel Vollweiler  <marcel@codesourcery.com>

	* gfortran.dg/gomp/target-device-ancestor-4.f90: Comment out dg-final to avoid
	UNRESOLVED.

2021-08-31  Marcel Vollweiler  <marcel@codesourcery.com>

	Backported from master:
	2021-08-31  Marcel Vollweiler  <marcel@codesourcery.com>

	* c-parser.c (c_parser_omp_clause_device): Parse device-modifiers 'device_num'
	and 'ancestor' in 'target device' clauses.
	* parser.c (cp_parser_omp_clause_device): Parse device-modifiers 'device_num'
	and 'ancestor' in 'target device' clauses.
	* semantics.c (finish_omp_clauses): Error handling. Constant device ids must
	evaluate to '1' if 'ancestor' is used.
	* gfortran.h: Add variable for 'ancestor' in struct gfc_omp_clauses.
	* openmp.c (gfc_match_omp_clauses): Parse device-modifiers 'device_num'
	and 'ancestor' in 'target device' clauses.
	* trans-openmp.c (gfc_trans_omp_clauses): Set OMP_CLAUSE_DEVICE_ANCESTOR.
	* gimplify.c (gimplify_scan_omp_clauses): Error handling. 'ancestor' only
	allowed on target constructs and only with particular other clauses.
	* omp-expand.c (expand_omp_target): Output of 'sorry, not supported' if
	'ancestor' is used.
	* omp-low.c (check_omp_nesting_restrictions): Error handling. No nested OpenMP
	structs when 'ancestor' is used.
	(scan_omp_1_stmt): No usage of OpenMP runtime routines in a target region when
	'ancestor' is used.
	* tree-pretty-print.c (dump_omp_clause): Append 'ancestor'.
	* tree.h (OMP_CLAUSE_DEVICE_ANCESTOR): Define macro.
	* c-c++-common/gomp/target-device-1.c: New test.
	* c-c++-common/gomp/target-device-2.c: New test.
	* c-c++-common/gomp/target-device-ancestor-1.c: New test.
	* c-c++-common/gomp/target-device-ancestor-2.c: New test.
	* c-c++-common/gomp/target-device-ancestor-3.c: New test.
	* c-c++-common/gomp/target-device-ancestor-4.c: New test.
	* gfortran.dg/gomp/target-device-1.f90: New test.
	* gfortran.dg/gomp/target-device-2.f90: New test.
	* gfortran.dg/gomp/target-device-ancestor-1.f90: New test.
	* gfortran.dg/gomp/target-device-ancestor-2.f90: New test.
	* gfortran.dg/gomp/target-device-ancestor-3.f90: New test.
	* gfortran.dg/gomp/target-device-ancestor-4.f90: New test.

2021-08-23  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-08-23  Jakub Jelinek  <jakub@redhat.com>

	* tree.h (OMP_CLAUSE_GRAINSIZE_STRICT): Define.
	(OMP_CLAUSE_NUM_TASKS_STRICT): Define.
	* tree-pretty-print.c (dump_omp_clause) <case OMP_CLAUSE_GRAINSIZE,
	case OMP_CLAUSE_NUM_TASKS>: Print strict: modifier.
	* omp-expand.c (expand_task_call): Use GOMP_TASK_FLAG_STRICT in iflags
	if either grainsize or num_tasks clause has the strict modifier.

2021-08-20  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-08-20  Jakub Jelinek  <jakub@redhat.com>

	* omp-builtins.def (BUILT_IN_GOMP_WARNING, BUILT_IN_GOMP_ERROR): New
	builtins.

2021-08-17  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-08-17  Jakub Jelinek  <jakub@redhat.com>

	* tree.def (OMP_SCOPE): New tree code.
	* tree.h (OMP_SCOPE_BODY, OMP_SCOPE_CLAUSES): Define.
	* tree-nested.c (convert_nonlocal_reference_stmt,
	convert_local_reference_stmt, convert_gimple_call): Handle
	GIMPLE_OMP_SCOPE.
	* tree-pretty-print.c (dump_generic_node): Handle OMP_SCOPE.
	* gimple.def (GIMPLE_OMP_SCOPE): New gimple code.
	* gimple.c (gimple_build_omp_scope): New function.
	(gimple_copy): Handle GIMPLE_OMP_SCOPE.
	* gimple.h (gimple_build_omp_scope): Declare.
	(gimple_has_substatements): Handle GIMPLE_OMP_SCOPE.
	(gimple_omp_scope_clauses, gimple_omp_scope_clauses_ptr,
	gimple_omp_scope_set_clauses): New inline functions.
	(CASE_GIMPLE_OMP): Add GIMPLE_OMP_SCOPE.
	* gimple-pretty-print.c (dump_gimple_omp_scope): New function.
	(pp_gimple_stmt_1): Handle GIMPLE_OMP_SCOPE.
	* gimple-walk.c (walk_gimple_stmt): Likewise.
	* gimple-low.c (lower_stmt): Likewise.
	* gimplify.c (is_gimple_stmt): Handle OMP_MASTER.
	(gimplify_scan_omp_clauses): For task reductions, handle OMP_SCOPE
	like ORT_WORKSHARE constructs.  Adjust diagnostics for %<scope%>
	allowing task reductions.  Reject inscan reductions on scope.
	(omp_find_stores_stmt): Handle GIMPLE_OMP_SCOPE.
	(gimplify_omp_workshare, gimplify_expr): Handle OMP_SCOPE.
	* tree-inline.c (remap_gimple_stmt): Handle GIMPLE_OMP_SCOPE.
	(estimate_num_insns): Likewise.
	* omp-low.c (build_outer_var_ref): Look through GIMPLE_OMP_SCOPE
	contexts if var isn't privatized there.
	(check_omp_nesting_restrictions): Handle GIMPLE_OMP_SCOPE.
	(scan_omp_1_stmt): Likewise.
	(maybe_add_implicit_barrier_cancel): Look through outer
	scope constructs.
	(lower_omp_scope): New function.
	(lower_omp_task_reductions): Handle OMP_SCOPE.
	(lower_omp_1): Handle GIMPLE_OMP_SCOPE.
	(diagnose_sb_1, diagnose_sb_2): Likewise.
	* omp-expand.c (expand_omp_single): Support also GIMPLE_OMP_SCOPE.
	(expand_omp): Handle GIMPLE_OMP_SCOPE.
	(omp_make_gimple_edges): Likewise.
	* omp-builtins.def (BUILT_IN_GOMP_SCOPE_START): New built-in.

2021-08-16  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-08-16  Tobias Burnus  <tobias@codesourcery.com>

	PR middle-end/101931
	* omp-low.c (omp_runtime_api_call): Update for routines
	added in the meanwhile.

2021-08-16  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-08-12  Jakub Jelinek  <jakub@redhat.com>

	* tree.def (OMP_MASKED): New tree code.
	* tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_FILTER.
	* tree.h (OMP_MASKED_BODY, OMP_MASKED_CLAUSES, OMP_MASKED_COMBINED,
	OMP_CLAUSE_FILTER_EXPR): Define.
	* tree.c (omp_clause_num_ops): Add OMP_CLAUSE_FILTER entry.
	(omp_clause_code_name): Likewise.
	(walk_tree_1): Handle OMP_CLAUSE_FILTER.
	* tree-nested.c (convert_nonlocal_omp_clauses,
	convert_local_omp_clauses): Handle OMP_CLAUSE_FILTER.
	(convert_nonlocal_reference_stmt, convert_local_reference_stmt,
	convert_gimple_call): Handle GIMPLE_OMP_MASTER.
	* tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE_FILTER.
	(dump_generic_node): Handle OMP_MASTER.
	* gimple.def (GIMPLE_OMP_MASKED): New gimple code.
	* gimple.c (gimple_build_omp_masked): New function.
	(gimple_copy): Handle GIMPLE_OMP_MASKED.
	* gimple.h (gimple_build_omp_masked): Declare.
	(gimple_has_substatements): Handle GIMPLE_OMP_MASKED.
	(gimple_omp_masked_clauses, gimple_omp_masked_clauses_ptr,
	gimple_omp_masked_set_clauses): New inline functions.
	(CASE_GIMPLE_OMP): Add GIMPLE_OMP_MASKED.
	* gimple-pretty-print.c (dump_gimple_omp_masked): New function.
	(pp_gimple_stmt_1): Handle GIMPLE_OMP_MASKED.
	* gimple-walk.c (walk_gimple_stmt): Likewise.
	* gimple-low.c (lower_stmt): Likewise.
	* gimplify.c (is_gimple_stmt): Handle OMP_MASTER.
	(gimplify_scan_omp_clauses): Handle OMP_CLAUSE_FILTER.  For clauses
	that take one expression rather than decl or constant, force
	gimplification of that into a SSA_NAME or temporary unless min
	invariant.
	(gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_FILTER.
	(gimplify_expr): Handle OMP_MASKED.
	* tree-inline.c (remap_gimple_stmt): Handle GIMPLE_OMP_MASKED.
	(estimate_num_insns): Likewise.
	* omp-low.c (scan_sharing_clauses): Handle OMP_CLAUSE_FILTER.
	(check_omp_nesting_restrictions): Handle GIMPLE_OMP_MASKED.  Adjust
	diagnostics for existence of masked construct.
	(scan_omp_1_stmt, lower_omp_master, lower_omp_1, diagnose_sb_1,
	diagnose_sb_2): Handle GIMPLE_OMP_MASKED.
	* omp-expand.c (expand_omp_synch, expand_omp, omp_make_gimple_edges):
	Likewise.

2021-08-16  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-08-12  Tobias Burnus  <tobias@codesourcery.com>

	* tree-core.h (omp_clause_proc_bind_kind): Add
	OMP_CLAUSE_PROC_BIND_PRIMARY.
	* tree-pretty-print.c (dump_omp_clause): Add TODO comment to
	change 'master' to 'primary' in proc_bind for OpenMP 5.1.

2021-07-26  Thomas Schwinge  <thomas@codesourcery.com>

	Backported from master:
	2021-07-12  Martin Liska  <mliska@suse.cz>

	PR sanitizer/101425
	* gcc.c (check_offload_target_name): Call
	  candidates_list_and_hint only if we have a candidate.

	Backported from master:
	2021-06-30  Tobias Burnus  <tobias@codesourcery.com>

	* common.opt (foffload): Remove help as Driver only.
	* gcc.c (display_help): Add -foffload.

	Backported from master:
	2021-06-30  Tobias Burnus  <tobias@codesourcery.com>

	* gcc.c (close_at_file, execute): Replace alloca by XALLOCAVEC.
	(check_offload_target_name): Fix splitting OFFLOAD_TARGETS into
	a candidate list; better inform no offload target is configured
	and fix hint extraction when passed target is not '\0' at [len].
	* common.opt (foffload): Add tailing '.'.
	(foffload-options): Likewise; fix flag name in the help string.

2021-07-20  Andrew Stubbs  <ams@codesourcery.com>

	Backport from master:
	PR target/100208
	* config/gcn/gcn-hsa.h (DRIVER_SELF_SPECS): New.
	(ASM_SPEC): Set -mattr for xnack and sram-ecc.
	* config/gcn/gcn-opts.h (enum sram_ecc_type): New.
	* config/gcn/gcn-valu.md: Add a warning comment.
	* config/gcn/gcn.c (gcn_option_override): Add "sorry" for -mxnack.
	(output_file_start): Add xnack and sram-ecc state to ".amdgcn_target".
	* config/gcn/gcn.md: Add a warning comment.
	* config/gcn/gcn.opt: Add -mxnack and -msram-ecc.
	* config/gcn/mkoffload.c (EF_AMDGPU_MACH_AMDGCN_GFX908): Remove
	SRAM-ECC flag.
	(EF_AMDGPU_XNACK): New.
	(EF_AMDGPU_SRAM_ECC): New.
	(elf_flags): New.
	(copy_early_debug_info): Use elf_flags.
	(main): Handle -mxnack and -msram-ecc options.
	* doc/invoke.texi: Document -mxnack and -msram-ecc.

2021-06-29  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-06-29  Tobias Burnus  <tobias@codesourcery.com>

	* gcc.c (check_offload_target_name): Cast len argument to
	%q.*s to 'int'; avoid -Wstringop-truncation warning.

2021-06-29  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-06-29  Tobias Burnus  <tobias@codesourcery.com>

	PR other/67300
	* common.opt (-foffload=): Update description.
	(-foffload-options=): New.
	* doc/invoke.texi (C Language Options): Document
	-foffload and -foffload-options.
	* gcc.c (check_offload_target_name): New, split off from
	handle_foffload_option.
	(check_foffload_target_names): New.
	(handle_foffload_option): Handle -foffload=default.
	(driver_handle_option): Update for -foffload-options.
	* lto-opts.c (lto_write_options): Use -foffload-options
	instead of -foffload.
	* lto-wrapper.c (merge_and_complain, append_offload_options):
	Likewise.
	* opts.c (common_handle_option): Likewise.

2021-06-29  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-06-29  Tobias Burnus  <tobias@codesourcery.com>

	* doc/invoke.texi (C Language Options): Sort options
	alphabetically in optlist and also the description itself.
	Remove leftover -fallow-single-precision from and add missing
	-fgnu-tm to the optlist.

2021-06-23  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-06-23  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/101167
	* omp-low.c (lower_omp_regimplify_p): Regimplify also PARM_DECLs
	and RESULT_DECLs that have DECL_HAS_VALUE_EXPR_P set.

2021-06-22  Marcel Vollweiler  <marcel@codesourcery.com>

	gcc/configure.ac: fix register issue for global_load assembler functions

	* config.in: Regenerate.
	* config/gcn/gcn.c (print_operand_address): Fix for global_load
	assembler functions.
	* configure: Regenerate.
	* configure.ac: Fix for global_load assembler functions.

2021-06-15  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-06-15  Tobias Burnus  <tobias@codesourcery.com>

	PR fortran/92568
	* gimplify.c (enum gimplify_defaultmap_kind): Add GDMK_SCALAR_TARGET.
	(struct gimplify_omp_ctx): Extend defaultmap array by one.
	(new_omp_context): Init defaultmap[GDMK_SCALAR_TARGET].
	(omp_notice_variable): Update type classification for Fortran.
	(gimplify_scan_omp_clauses): Update calls for new argument; handle
	GDMK_SCALAR_TARGET; for Fortran, GDMK_POINTER avoid GOVD_MAP_0LEN_ARRAY.
	* langhooks-def.h (lhd_omp_scalar_p): Add 'ptr_ok' argument.
	* langhooks.c (lhd_omp_scalar_p): Likewise.
	(LANG_HOOKS_OMP_ALLOCATABLE_P, LANG_HOOKS_OMP_SCALAR_TARGET_P): New.
	(LANG_HOOKS_DECLS): Add them.
	* langhooks.h (struct lang_hooks_for_decls): Add new hooks, update
	omp_scalar_p pointer type to include the new bool argument.

2021-06-15  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-06-11  Thomas Schwinge  <thomas@codesourcery.com>

	* tree-pretty-print.h (dump_omp_clauses): Add 'bool = true'
	default argument.
	* tree-pretty-print.c (dump_omp_clauses): Update.
	(dump_generic_node) <OMP_CLAUSE>: Use it.

2021-06-08  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-06-08  Jakub Jelinek  <jakub@redhat.com>

	PR c++/100957
	* tree-inline.c (copy_tree_body_r): For OMP_CLAUSE_DEPEND don't
	check TREE_CODE if OMP_CLAUSE_DECL is NULL.

2021-06-04  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-06-04  Tobias Burnus  <tobias@codesourcery.com>

	* tree-nested.c (convert_nonlocal_omp_clauses,
	convert_local_omp_clauses): Handle OMP_CLAUSE_BIND.

2021-06-04  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-06-03  Jakub Jelinek  <jakub@redhat.com>

	PR c++/100859
	* tree-inline.c (copy_tree_body_r): Handle iterators on
	OMP_CLAUSE_AFFINITY or OMP_CLAUSE_DEPEND.

2021-05-31  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-05-29  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/99928
	* gimplify.c (gimplify_scan_omp_clauses): For taskloop simd
	combined with parallel, make sure to add shared clause to
	parallel for explicit linear clause.

2021-05-28  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-05-28  Jakub Jelinek  <jakub@redhat.com>

	* tree.h (OMP_CLAUSE_MAP_IMPLICIT): Define.

2021-05-28  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-05-28  Tobias Burnus  <tobias@codesourcery.com>

	* gimplify.c (gimplify_omp_affinity): New.
	(gimplify_scan_omp_clauses): Call it; remove affinity clause afterwards.
	* tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_AFFINITY.
	* tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE_AFFINITY.
	* tree.c (omp_clause_num_ops, omp_clause_code_name): Add clause.
	(walk_tree_1): Handle OMP_CLAUSE_AFFINITY.

2021-05-26  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-05-26  Jakub Jelinek  <jakub@redhat.com>

	PR libgomp/100573
	* omp-low.c: Include omp-offload.h.
	(create_omp_child_function): If current_function_decl has
	"omp declare target" attribute and is_gimple_omp_offloaded,
	remove that attribute from the copy of attribute list and
	add "omp target entrypoint" attribute instead.
	(lower_omp_target): Mark .omp_data_sizes.* and .omp_data_kinds.*
	variables for offloading if in omp_maybe_offloaded_ctx.
	* omp-offload.c (pass_omp_target_link::execute): Nullify second
	argument to GOMP_target_data_ext in offloaded code.

2021-05-23  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-05-21  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/99928
	* tree.h (OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET): Define.
	* gimplify.c (enum gimplify_omp_var_data): Fix up
	GOVD_MAP_HAS_ATTACHMENTS value, add GOVD_FIRSTPRIVATE_IMPLICIT.
	(omp_lastprivate_for_combined_outer_constructs): If combined target
	has GOVD_FIRSTPRIVATE_IMPLICIT set for the decl, change it to
	GOVD_MAP | GOVD_SEEN.
	(gimplify_scan_omp_clauses): Set GOVD_FIRSTPRIVATE_IMPLICIT for
	firstprivate clauses with OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT.
	(gimplify_adjust_omp_clauses): For firstprivate clauses with
	OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT either clear that bit and
	OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET too, or remove it and
	let it be replaced by implicit map clause.

2021-05-23  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-05-21  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/99928
	* gimplify.c (omp_lastprivate_for_combined_outer_constructs): New
	function.
	(gimplify_scan_omp_clauses) <case OMP_CLAUSE_LASTPRIVATE>: Use it.
	(gimplify_omp_for): Likewise.

2021-05-20  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-05-20  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/99928
	* gimplify.c (gimplify_scan_omp_clauses) <case OMP_CLAUSE_LINEAR>: For
	explicit linear clause when combined with target, make it map(tofrom:)
	instead of no clause or firstprivate.

2021-05-19  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-05-19  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/99928
	* tree.h (OMP_MASTER_COMBINED): Define.
	* gimplify.c (gimplify_scan_omp_clauses): Rewrite lastprivate
	handling for outer combined/composite constructs to a loop.
	Handle lastprivate on combined target.
	(gimplify_expr): Formatting fix.

2021-05-18  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-05-17  Tom de Vries  <tdevries@suse.de>

	PR target/100497
	* config/nvptx/nvptx-protos.h (nvptx_output_atomic_insn): Declare
	* config/nvptx/nvptx.c (nvptx_output_barrier)
	(nvptx_output_atomic_insn): New function.
	(nvptx_print_operand): Add support for 'B'.
	* config/nvptx/nvptx.md: Use nvptx_output_atomic_insn for atomic
	insns.

2021-05-14  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-05-12  Tom de Vries  <tdevries@suse.de>

	PR target/96005
	* config/nvptx/nvptx-opts.h (enum ptx_version): New enum.
	* config/nvptx/nvptx.c (nvptx_file_start): Print .version according
	to ptx_version_option.
	* config/nvptx/nvptx.h (TARGET_PTX_6_3): Define.
	* config/nvptx/nvptx.md (define_insn "nvptx_shuffle<mode>")
	(define_insn "nvptx_vote_ballot"): Use sync variant for
	TARGET_PTX_6_3.
	* config/nvptx/nvptx.opt (ptx_version): Add enum.
	(mptx): Add option.
	* doc/invoke.texi (Nvidia PTX Options): Add mptx item.

2021-05-14  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-05-07  Tobias Burnus  <tobias@codesourcery.com>
		    Tom de Vries  <tdevries@suse.de>

	* omp-low.c (lower_rec_simd_input_clauses): Set max_vf = 1 if
	a truth_value_p reduction variable is nonintegral.

2021-05-14  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-05-04  Tobias Burnus  <tobias@codesourcery.com>

	* omp-low.c (lower_rec_input_clauses, lower_reduction_clauses): Handle
	&& and || with floating-point and complex arguments.

2021-05-14  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-05-03  Tom de Vries  <tdevries@suse.de>

	PR target/100321
	* omp-low.c (lower_rec_input_clauses): Disable SIMT for user-defined
	reduction.

2021-05-14  Tobias Burnus  <tobias@codesourcery.com>

	Backported from master:
	2021-04-29  Tom de Vries  <tdevries@suse.de>

	* omp-expand.c (expand_omp_simd): Add step_orig, and replace uses of
	fd->loop.step by either step or orig_step.
	Backported from master:

2021-05-13  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* omp-offload.c (oacc_xform_loop): Remove vec_tiles.

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

	* tree.h (OMP_CLAUSE_MAP_IMPLICIT_P): New access macro for 'implicit'
	bit, using 'base.deprecated_flag' field of tree_node.
	* tree-pretty-print.c (dump_omp_clause): Add support for printing
	implicit attribute in tree dumping.
	* gimplify.c (gimplify_adjust_omp_clauses_1):
	Set OMP_CLAUSE_MAP_IMPLICIT_P to 1 if map clause is implicitly created.
	(gimplify_adjust_omp_clauses): Adjust place of adding implicitly created
	clauses, from simple append, to starting of list, after non-map clauses.
	* omp-low.c (lower_omp_target): Add GOMP_MAP_IMPLICIT bits into kind
	values passed to libgomp for implicit maps.

2021-04-30  Kwok Cheung Yeung  <kcy@codesourcery.com>

	Backport from mainline
	2021-04-23  Thomas Schwinge  <thomas@codesourcery.com>

	* omp-offload.c (oacc_validate_dims): Implement
	'-Wopenacc-parallelism'.
	* doc/invoke.texi (-Wopenacc-parallelism): Document.

2021-04-07  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* omp-low.c (is_oacc_parallel_or_serial): Handle
	GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_PARALLELIZED and
	GF_OMP_TARGET_KIND_OACC_PARALLEL_KERNELS_GANG_SINGLE.

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

	* omp-expand.c (expand_oacc_for): Convert .tile variable to
	diff_type before multiplying.
	* omp-general.c (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.

2020-08-24  Tobias Burnus  <tobias@codesourcery.com>

	* omp-sese.c: Fix comment typo.

2020-08-19  Sandra Loosemore  <sandra@codesourcery.com>

	Add a "combined" flag for "acc kernels loop" etc directives.

	* tree.h (OACC_LOOP_COMBINED): New.

2020-07-30  Julian Brown  <julian@codesourcery.com>

	* config/gcn/gcn-tree.c (gcn_goacc_get_worker_red_decl): Do not
	cache/share decls for reduction temporaries between invocations.
	(gcn_goacc_reduction_teardown): Unshare VAR on second use.
	* config/gcn/gcn.c (gcn_init_machine_status): Do not initialise
	reduc_decls.
	* config/gcn/gcn.h (machine_function): Remove reduc_decls cache.

2020-07-30  Julian Brown  <julian@codesourcery.com>

	* config/gcn/gcn-tree.c (gcn_goacc_reduction_teardown): Remove useless
	temporary variable "decl".

2020-07-15  Kwok Cheung Yeung  <kcy@codesourcery.com>
	    Andrew Stubbs   <ams@codesourcery.com>

	* plugin/plugin-gcn.c (parse_target_attributes): Automatically set
	the number of teams and threads if necessary.
	(gcn_exec): Automatically set the number of gangs and workers if
	necessary.

2020-07-15  Julian Brown  <julian@codesourcery.com>

	* config/gcn/gcn.c (gimple.h): Include.
	(gcn_fork_join): Emit barrier for worker-level joins.
	* omp-sese.c (find_local_vars_to_propagate): Add writes_gangprivate
	bitmap parameter. Set bit for blocks containing gang-private variable
	writes.
	(worker_single_simple): Don't emit barrier after predicated block.
	(worker_single_copy): Don't emit barrier if we're not broadcasting
	anything and the block contains no gang-private writes.
	(neuter_worker_single): Don't predicate blocks that only contain NOPs
	or internal marker functions.  Pass has_gangprivate_write argument to
	worker_single_copy.
	(oacc_do_neutering): Add writes_gangprivate bitmap handling.

2020-07-15  Julian Brown  <julian@codesourcery.com>

	* config/gcn/gcn-valu.md (scatter<mode>_insn_1offset_ds<exec_scatter>):
	Add waitcnt.
	(*mov<mode>_insn, *movti_insn): Add waitcnt to ds_write alternatives.

2020-07-15  Julian Brown  <julian@codesourcery.com>

	* config/gcn/gcn-protos.h (gcn_goacc_adjust_private_decl): Update
	prototype.
	* config/gcn/gcn-tree.c (gcn_goacc_get_worker_red_decl): Use
	preallocated block of LDS memory.
	(gcn_goacc_create_propagation_record): Add OFFSET parameter, and return
	temporary LDS space at that offset.  Return pointer in "sender" case.
	(gcn_goacc_adjust_private_decl): Return var.
	* config/gcn/gcn.c (acc_lds_size, gangprivate_hwm, lds_allocs): New
	global vars.
	(ACC_LDS_SIZE): Define as acc_lds_size.
	(gcn_init_machine_status): Don't initialise lds_allocated and
	lds_allocs fields of machine function struct.
	(gcn_option_override): Handle default size for gang-private variables
	and -mgang-local-size option.
	(gcn_expand_prologue): Use LDS_SIZE instead of LDS_SIZE-1 when
	initialising M0_REG.
	(gcn_shared_mem_layout): New function.
	(gcn_print_lds_decl): Update comment. Use global lds_allocs map and
	gangprivate_hwm variable.
	(TARGET_GOACC_SHARED_MEM_LAYOUT): Define target hook.
	* config/gcn/gcn.h (machine_function): Remove lds_allocated,
	lds_allocs. Add reduction_base, reduction_limit.
	* config/gcn/gcn.opt (gang_local_size_opt): New global.
	(mgang-local-size=): New option.
	* config/nvptx/nvptx.c (nvptx_goacc_adjust_private_decl): Return var.
	* doc/tm.texi.in (TARGET_GOACC_SHARED_MEM_LAYOUT): Place documentation
	hook.
	* doc/tm.texi: Regenerate.
	* omp-offload.c (addr_expr_rewrite_info): Change adjusted_vars to a
	hash_map.
	(rewrite_addr_expr): Rewrite VAR_DECLs also.
	(default_goacc_create_propagation_record): Add OFFSET parameter.
	(execute_oacc_gimple_workers): Calculate per-function reduction
	temporary and private-variable size.  Call OpenACC shared_mem_layout
	hook.  Move num_workers==1 handling here.
	(execute_oacc_device_lower): Fix for adjusted_vars being a hash_map
	rather than a hash_set.
	(pass_oacc_gimple_workers::gate): Remove num_workers==1 handling from
	here.  Enable pass for all OpenACC routines in order to call shared
	memory-layout hook.
	* omp-sese.c (targhooks.h, diagnostic-core.h): Add includes.
	(build_sender_ref): Handle sender_decl being pointer.
	(worker_single_copy): Add PLACEMENT and ISOLATE_BROADCASTS parameters.
	Pass placement argument to create_propagation_record hook invocations.
	Handle sender_decl being pointer and isolate_broadcasts inserting extra
	barriers.
	(blk_offset_map_t): Add typedef.
	(neuter_worker_single): Add BLK_OFFSET_MAP parameter.  Pass
	preallocated range to worker_single_copy call.
	(dfs_broadcast_reachable_1): New function.
	(idx_decl_pair_t, used_range_vec_t): New typedefs.
	(sort_size_descending): New function.
	(addr_range): New class.
	(splay_tree_compare_addr_range, splay_tree_free_key, first_fit_range,
	merge_ranges_1, merge_ranges): New functions.
	(oacc_do_neutering): Add BOUNDS_LO, BOUNDS_HI parameters.  Arrange
	layout of shared memory for broadcast operations.
	* omp-sese.h (oacc_do_neutering): Update prototype.
	* target.def (adjust_private_decl): Change return type to tree.
	(create_propagation_record): Add OFFSET parameter.
	(shared_mem_layout): New hook.
	* targhooks.h (default_goacc_create_propagation_record): Update
	prototype.

2020-07-15  Julian Brown  <julian@codesourcery.com>

	* omp-offload.c (pass_oacc_gimple_workers::gate): Disable worker
	partitioning if num_workers is 1.

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

	* omp-sese.c (oacc_build_component_ref): Apply address space of
	base object to the entire component reference.

2020-03-27  Sandra Loosemore  <sandra@codesourcery.com>

	* doc/invoke.texi (Option Summary): Add entries for
	-Wopenacc-kernels-annotate-loops and
	-fno-openacc-kernels-annotate-loops.
	(Warning Options): Document -Wopenacc-kernels-annotate-loops.
	(Optimization Options): Document -fno-openacc-kernels-annotate-loops.

2020-03-19  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* omp-offload.c (oacc_loop_auto_partitions): Check for 'omp declare
	target' attributes with a gang clause attached.

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

	* omp-oacc-kernels-decompose.cc (maybe_build_inner_data_region):
	is_gimple_reg vars are not yet mapped, fall through to map is as
	before the transformation.
	(omp_oacc_kernels_decompose_1): Don't map is_gimple_reg vars.
	(decompose_kernels_region_body): Use tofrom for is_gimple_reg vars.
	(omp_oacc_kernels_decompose_1): Handle is_gimple_reg vars as without
	data kernels.

2020-03-12  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* omp-sese.c (install_var_field): Generate a field name for a VAR_DECL
	using the DECL_UID if it does not have a DECL_NAME.

2019-10-21  Julian Brown  <julian@codesourcery.com>

	* omp-oacc-kernels-decompose.cc (decompose_kernels_region_body): Add
	inhibit_async parameter.  Force asynchronous kernel launches to
	run synchronously if they have problematic variable mappings.
	Don't add explicit wait for decomposed kernels regions we forced
	synchronous.
	(omp_oacc_kernels_decompose_1): Detect problematic variable mappings,
	and inhibit asynchronous execution if we find any.

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

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

2020-02-20  Kwok Cheung Yeung  <kcy@codesourcery.com>

	* omp-general.c (oacc_verify_routine_clauses): Handle
	OMP_CLAUSE_NOHOST.

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

	* gimplify.c (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-10-16  Julian Brown  <julian@codesourcery.com>
	    Tobias Burnus  <tobias@codesourcery.com>

	* config/gcn/gcn-protos.h (gcn_goacc_adjust_gangprivate_decl): Rename
	to...
	(gcn_goacc_adjust_private_decl): ...this.
	* config/gcn/gcn-tree.c (diagnostic-core.h): Include.
	(gcn_goacc_adjust_gangprivate_decl): Rename to...
	(gcn_goacc_adjust_private_decl): ...this. Add LEVEL parameter.
	* config/gcn/gcn.c (TARGET_GOACC_ADJUST_GANGPRIVATE_DECL): Rename to...
	(TARGET_GOACC_ADJUST_PRIVATE_DECL): ...this.
	* config/nvptx/nvptx.c (tree-pretty-print.h): Include.
	(nvptx_goacc_adjust_private_decl): New function.
	(TARGET_GOACC_ADJUST_PRIVATE_DECL): Define hook using above function.
	* doc/tm.texi.in (TARGET_GOACC_ADJUST_GANGPRIVATE_DECL): Rename to...
	(TARGET_GOACC_ADJUST_PRIVATE_DECL): ...this.
	* doc/tm.texi: Regenerated.
	* internal-fn.c (expand_UNIQUE): Handle IFN_UNIQUE_OACC_PRIVATE.
	* internal-fn.h (IFN_UNIQUE_CODES): Add OACC_PRIVATE.
	* omp-low.c (omp_context): Remove oacc_partitioning_levels field.
	(lower_oacc_reductions): Add PRIVATE_MARKER parameter.  Insert before
	fork.
	(lower_oacc_head_tail): Add PRIVATE_MARKER parameter. Modify its
	gimple call arguments as appropriate. Don't set
	oacc_partitioning_levels in omp_context. Pass private_marker to
	lower_oacc_reductions.
	(oacc_record_private_var_clauses): Don't check for NULL ctx.
	(mark_oacc_gangprivate): Remove unused function.
	(make_oacc_private_marker): New function.
	(lower_omp_for): Only call oacc_record_vars_in_bind for
	OpenACC contexts.  Create private marker and pass to
	lower_oacc_head_tail.
	(lower_omp_target): Remove unnecessary call to
	oacc_record_private_var_clauses. Remove call to mark_oacc_gangprivate.
	Create private marker and pass to lower_oacc_reductions.
	(process_oacc_gangprivate_1): Remove.
	(lower_omp_1): Only call oacc_record_vars_in_bind for OpenACC.  Don't
	iterate over contexts calling process_oacc_gangprivate_1.
	(omp-offload.c (oacc_loop_xform_head_tail): Treat
	private-variable markers like fork/join when transforming head/tail
	sequences.
	(execute_oacc_device_lower): Use IFN_UNIQUE_OACC_PRIVATE instead of
	"oacc gangprivate" attributes to determine partitioning level of
	variables.  Remove unused variables.
	* omp-sese.c (find_gangprivate_vars): New function.
	(find_local_vars_to_propagate): Use GANGPRIVATE_VARS parameter instead
	of "oacc gangprivate" attribute to determine which variables are
	gang-private.
	(oacc_do_neutering): Use find_gangprivate_vars.
	* target.def (adjust_gangprivate_decl): Rename to...
	(adjust_private_decl): ...this.  Update documentation (briefly).

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

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

2019-09-17  Tobias Burnus  <tobias@codesourcery.com>

	* gimplify.c (gomp_oacc_needs_data_present): Remove unused variables.
	* omp-low.c (process_oacc_gangprivate_1): Comment unused
	parameter name to silence unused warning.
	* omp-sese.c (omp_sese_number, omp_sese_pseudo): Remove
	superfluous ().
	(oacc_do_neutering): Use signed int to avoid a warning.

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

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

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

	* config/nvptx/nvptx.c (omp-sese.h): Include.
	(bb_pair_t, bb_pair_vec_t, pseudo_node_t, bracket, bracket_vec_t,
	bb_sese, bb_sese::~bb_sese, bb_sese::append, bb_sese::remove,
	BB_SET_SESE, BB_GET_SESE, nvptx_sese_number, nvptx_sese_pseudo,
	nvptx_sese_color, nvptx_find_sese): Remove.
	(nvptx_neuter_pars): Call omp_find_sese instead of nvptx_find_sese.
	* omp-sese.c (omp-sese.h): Include.
	(struct parallel): Rename to...
	(struct parallel_g): This.
	(parallel::parallel, parallel::~parallel): Rename to...
	(parallel_g::parallel_g, parallel_g::~parallel_g): These.
	(omp_sese_dump_pars, omp_sese_find_par, omp_sese_discover_pars,
	populate_single_mode_bitmaps, find_ssa_names_to_propagate,
	find_partitioned_var_uses, find_local_vars_to_propagate,
	neuter_worker_single): Update for parallel_g name change.
	(bb_pair_t, bb_pair_vec_t): Remove.
	(omp_find_sese): Make global.
	* omp-sese.h (bb_pair_t, bb_pair_vec_t): New.
	(omp_find_sese): Add prototype.

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

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

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

	* config/gcn/gcn.c (gcn_goacc_validate_dims): Remove
	no-flag_worker-partitioning assertion.
	(TARGET_GOACC_WORKER_PARTITIONING): Define target hook to true.
	* config/gcn/gcn.opt (flag_worker_partitioning): Change default to 1.

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

	* gimplify.c (privatize_reduction): New struct.
	(localize_reductions_r, localize_reductions): New functions.
	(gimplify_omp_for): Call localize_reductions.
	(gimplify_omp_workshare): Likewise.
	* omp-low.c (lower_oacc_reductions): Handle localized reductions.
	Create fewer temp vars.
	* tree-core.h (omp_clause_code): Add OMP_CLAUSE_REDUCTION_PRIVATE_DECL
	documentation.
	* tree.c (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-09-05  Julian Brown  <julian@codesourcery.com>

	* config/gcn/gcn-protos.h (gcn_goacc_adjust_propagation_record): Rename
	prototype to...
	(gcn_goacc_create_propagation_record): This.
	* config/gcn/gcn-tree.c (gcn_goacc_adjust_propagation_record): Rename
	function to...
	(gcn_goacc_create_propagation_record): This.  Adjust comment.
	* config/gcn/gcn.c (gcn_init_builtins): Override decls for
	BUILT_IN_GOACC_SINGLE_START, BUILT_IN_GOACC_SINGLE_COPY_START,
	BUILT_IN_GOACC_SINGLE_COPY_END and BUILT_IN_GOACC_BARRIER.
	(gcn_fork_join): Remove inaccurate comment.
	(TARGET_GOACC_ADJUST_PROPAGATION_RECORD): Rename to...
	(TARGET_GOACC_CREATE_PROPAGATION_RECORD): This.

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

	* Makefile.in (OBJS): Add omp-sese.o.
	* omp-builtins.def (BUILT_IN_GOACC_BARRIER, BUILT_IN_GOACC_SINGLE_START,
	BUILT_IN_GOACC_SINGLE_COPY_START, BUILT_IN_GOACC_SINGLE_COPY_END): New
	builtins.
	* omp-offload.c (omp-sese.h): Include header.
	(oacc_loop_xform_head_tail): Call update_stmt for modified builtin
	calls.
	(oacc_loop_process): Likewise.
	(default_goacc_create_propagation_record): New default implementation
	for TARGET_GOACC_CREATE_PROPAGATION_RECORD hook.
	(execute_oacc_loop_designation): New.  Split out of oacc_device_lower.
	(execute_oacc_gimple_workers): New.  Likewise.
	(execute_oacc_device_lower): Recreate dims array.
	(pass_data_oacc_loop_designation, pass_data_oacc_gimple_workers): New.
	(pass_oacc_loop_designation, pass_oacc_gimple_workers): New.
	(make_pass_oacc_loop_designation, make_pass_oacc_gimple_workers): New.
	* omp-offload.h (oacc_fn_attrib_level): Add prototype.
	* omp-sese.c: New file.
	* omp-sese.h: New file.
	* passes.def (pass_oacc_loop_designation, pass_oacc_gimple_workers):
	Add passes.
	* target.def (worker_partitioning, create_propagation_record): Add
	target hooks.
	* targhooks.h (default_goacc_create_propagation_record): Add prototype.
	* tree-pass.h (make_pass_oacc_loop_designation,
	make_pass_oacc_gimple_workers): Add prototypes.
	* doc/tm.texi.in (TARGET_GOACC_WORKER_PARTITIONING,
	TARGET_GOACC_CREATE_PROPAGATION_RECORD): Add documentation hooks.
	* doc/tm.texi: Regenerate.

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

	* omp-offload.c (convert.h): Include.
	(struct addr_expr_rewrite_info): Add struct.
	(rewrite_addr_expr): New function.
	(is_sync_builtin_call): New function.
	(execute_oacc_device_lower): Support rewriting gang-private variables
	using target hook, and fix up addr_expr nodes afterwards.
	* target.def (adjust_gangprivate_decl): New target hook.
	* doc/tm.texi.in (TARGET_GOACC_ADJUST_GANGPRIVATE_DECL): Document new
	target hook.
	* doc/tm.texi: Regenerate.

2019-08-13  Julian Brown  <julian@codesourcery.com>

	* omp-oacc-kernels-decompose.cc (add_wait): New function, split out
	of...
	(add_async_clauses_and_wait): ...here. Call new outlined function.
	(decompose_kernels_region_body): Add wait at the end of
	explicitly-asynchronous kernels regions.

2019-07-10  Cesar Philippidis  <cesar@codesourcery.com>
	    Julian Brown  <julian@codesourcery.com>

	* gimplify.c (gimplify_adjust_omp_clauses_1): Raise error for
	assumed-size arrays in map clauses for Fortran/OpenMP.
	* omp-low.c (lower_omp_target): Set the size of assumed-size Fortran
	arrays to one to allow use of data already mapped on the offload device.

2019-05-28  Julian Brown  <julian@codesourcery.com>

	* omp-low.c (mark_oacc_gangprivate): Add CTX parameter.  Use to look up
	correct decl to add attribute to.
	(lower_omp_for): Move "oacc gangprivate" processing from here...
	(process_oacc_gangprivate_1): ...to here. New function.
	(lower_omp_target): Update call to mark_oacc_gangprivate.
	(execute_lower_omp): Call process_oacc_gangprivate_1 for each OMP
	context.

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

	* gimplify.c (gimplify_adjust_omp_clauses_1): Support implied no_alloc
	and optional arguments based on mappings in enclosing data regions.

2019-05-19  Julian Brown  <julian@codesourcery.com>

	* gimplify.c (oacc_array_mapping_info): Add REF field.
	(gimplify_scan_omp_clauses): Initialise above field for data blocks
	passed by reference.
	(gomp_oacc_needs_data_present): Handle references.
	(gimplify_adjust_omp_clauses_1): Handle references and optional
	arguments for variables declared in lexically-enclosing OpenACC data
	region.

2019-05-16  Julian Brown  <julian@codesourcery.com>

	* omp-oacc-kernels-decompose.cc (find_omp_for_index_vars_1,
	find_omp_for_index_vars): New functions.
	(maybe_build_inner_data_region): Add IDX_VARS argument. Don't add
	CREATE mapping clauses for loop index variables.  Set TREE_ADDRESSABLE
	flag on newly-mapped declarations as a side effect.
	(decompose_kernels_region_body): Call find_omp_for_index_vars.  Don't
	create PRESENT clause for loop index variables.  Pass index variable
	set to maybe_build_inner_data_region.

2019-01-23  Thomas Schwinge  <thomas@codesourcery.com>

	* params.opt (openacc_kernels): Default to decompose.

2018-12-11  Julian Brown  <julian@codesourcery.com>
	    Chung-Lin Tang  <cltang@codesourcery.com>

	* config/nvptx/nvptx.c (tree-hash-traits.h): Include.
	(gangprivate_shared_size): New global variable.
	(gangprivate_shared_align): Likewise.
	(gangprivate_shared_sym): Likewise.
	(gangprivate_shared_hmap): Likewise.
	(nvptx_option_override): Initialize gangprivate_shared_sym,
	gangprivate_shared_align.
	(nvptx_file_end): Output gangprivate_shared_sym.
	(nvptx_goacc_expand_accel_var): New function.
	(nvptx_set_current_function): New function.
	(TARGET_SET_CURRENT_FUNCTION): Define hook.
	(TARGET_GOACC_EXPAND_ACCEL): Likewise.
	* doc/tm.texi (TARGET_GOACC_EXPAND_ACCEL_VAR): Document new hook.
	* doc/tm.texi.in (TARGET_GOACC_EXPAND_ACCEL_VAR): Likewise.
	* expr.c (expand_expr_real_1): Remap decls marked with the
	"oacc gangprivate" attribute.
	* omp-low.c (omp_context): Add oacc_partitioning_level and
	oacc_addressable_var_decls fields.
	(new_omp_context): Initialize oacc_addressable_var_decls in new
	omp_context.
	(delete_omp_context): Delete oacc_addressable_var_decls in old
	omp_context.
	(lower_oacc_head_tail): Record partitioning-level count in omp context.
	(oacc_record_private_var_clauses, oacc_record_vars_in_bind)
	(mark_oacc_gangprivate): New functions.
	(lower_omp_for): Call oacc_record_private_var_clauses with "for"
	clauses.  Call mark_oacc_gangprivate for gang-partitioned loops.
	(lower_omp_target): Call oacc_record_private_var_clauses with "target"
	clauses.
	Call mark_oacc_gangprivate for offloaded target regions.
	(lower_omp_1): Call vars_in_bind for GIMPLE_BIND within OMP regions.
	* target.def (expand_accel_var): New hook.

2018-09-05  Cesar Philippidis  <cesar@codesourcery.com>
	    Chung-Lin Tang  <cltang@codesourcery.com>

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

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

	* omp-low.c (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.c (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-08-28  Julian Brown  <julian@codesourcery.com>
            Cesar Philippidis  <cesar@codesourcery.com>

	* gimplify.c (oacc_array_mapping_info): New struct.
	(gimplify_omp_ctx): Add decl_data_clause hash map.
	(new_omp_context): Zero-initialise above.
	(delete_omp_context): Delete above if allocated.
	(gimplify_scan_omp_clauses): Scan for array mappings on data constructs,
	and record in above map.
	(gomp_oacc_needs_data_present): New function.
	(gimplify_adjust_omp_clauses_1): Handle data mappings (e.g. array
	slices) declared in lexically-enclosing data constructs.
	* omp-low.c (lower_omp_target): Allow decl for bias not to be present
	in OpenACC context.

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.c (oacc_parse_default_dims): Update.
	(oacc_validate_dims): Emit warnings about strange partitioning choices.

2019-09-20  Chung-Lin Tang <cltang@codesourcery.com>
	    Cesar Philippidis  <cesar@codesourcery.com>

	* omp-expand.c (struct omp_region): Add inside_kernels_p field.
	(expand_omp_for_generic): Adjust to generate a 'sequential' loop
	when GOMP builtin arguments are BUILT_IN_NONE.
	(expand_omp_for): Use expand_omp_for_generic to generate a
	non-parallelized loop for OMP_FORs inside OpenACC kernels regions.
	(expand_omp): Mark inside_kernels_p field true for regions
	nested inside OpenACC kernels constructs.

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

	* omp-low.c (install_var_field): New base_pointer_restrict
	argument.
	(scan_sharing_clauses): Update call to install_var_field.
	(omp_target_base_pointers_restrict_p): New function.
	(scan_omp_target): Update call to install_var_field.

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

	* config/nvptx/nvptx.c (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.c (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.

2018-10-02  Thomas Schwinge  <thomas@codesourcery.com>
	    Cesar Philippidis  <cesar@codesourcery.com>

	* tree-core.h (omp_clause_code): Add OMP_CLAUSE_NOHOST.
	* tree.c (omp_clause_num_ops, omp_clause_code_name, walk_tree_1):
	Update for these.
	* tree-pretty-print.c (dump_omp_clause): Handle	OMP_CLAUSE_NOHOST.
	* gimplify.c (gimplify_scan_omp_clauses)
	(gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_NOHOST.
	* tree-nested.c (convert_nonlocal_omp_clauses)
	(convert_local_omp_clauses): Likewise.
	* omp-low.c (scan_sharing_clauses): Likewise.
	* omp-offload.c (maybe_discard_oacc_function): New function.
	(execute_oacc_device_lower) [!ACCEL_COMPILER]: Handle OpenACC
	nohost clauses.

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.c (gimplify_scan_omp_clauses): Skip gimplification of
	OMP_CLAUSE_SIZE of non-contiguous array maps (which is a TREE_LIST).
	* omp-expand.c (expand_omp_target): Add non-contiguous array descriptor
	pointers to variadic arguments.
	* omp-low.c (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.