Commit 178191e
committed
Fortran/OpenMP: Add omp loop [PR99928]
PR middle-end/99928
gcc/fortran/ChangeLog:
* dump-parse-tree.c (show_omp_clauses): Handle bind clause.
(show_omp_node): Handle loop directive.
* frontend-passes.c (gfc_code_walker): Likewise.
* gfortran.h (enum gfc_statement): Add
ST_OMP_(END_)(TARGET_)(|PARALLEL_|TEAMS_)LOOP.
(enum gfc_omp_bind_type): New.
(gfc_omp_clauses): Use it.
(enum gfc_exec_op): Add EXEC_OMP_(TARGET_)(|PARALLEL_|TEAMS_)LOOP.
* match.h (gfc_match_omp_loop, gfc_match_omp_parallel_loop,
gfc_match_omp_target_parallel_loop, gfc_match_omp_target_teams_loop,
gfc_match_omp_teams_loop): New.
* openmp.c (enum omp_mask1): Add OMP_CLAUSE_BIND.
(gfc_match_omp_clauses): Handle it.
(OMP_LOOP_CLAUSES, gfc_match_omp_loop, gfc_match_omp_teams_loop,
gfc_match_omp_target_teams_loop, gfc_match_omp_parallel_loop,
gfc_match_omp_target_parallel_loop): New.
(resolve_omp_clauses, resolve_omp_do, omp_code_to_statement,
gfc_resolve_omp_directive): Handle omp loop.
* parse.c (decode_omp_directive case_exec_markers, gfc_ascii_statement,
parse_omp_do, parse_executable): Likewise.
(parse_omp_structured_block): Remove ST_ which use parse_omp_do.
* resolve.c (gfc_resolve_blocks): Add omp loop.
* st.c (gfc_free_statement): Likewise.
* trans-openmp.c (gfc_trans_omp_clauses): Handle bind clause.
(gfc_trans_omp_do, gfc_trans_omp_parallel_do, gfc_trans_omp_distribute,
gfc_trans_omp_teams, gfc_trans_omp_target, gfc_trans_omp_directive):
Handle loop directive.
(gfc_split_omp_clauses): Likewise; fix firstprivate/lastprivate
and (in_)reduction for taskloop.
* trans.c (trans_code): Handle omp loop directive.
gcc/testsuite/ChangeLog:
* gfortran.dg/gomp/pr99928-3.f90: Add 'default(none)', following
C/C++ version of the patch.
* gfortran.dg/gomp/loop-1.f90: New test.
* gfortran.dg/gomp/loop-2.f90: New test.
* gfortran.dg/gomp/pr99928-1.f90: New test; based on C/C++ test.
* gfortran.dg/gomp/pr99928-11.f90: Likewise.
* gfortran.dg/gomp/pr99928-2.f90: Likewise.
* gfortran.dg/gomp/pr99928-4.f90: Likewise.
* gfortran.dg/gomp/pr99928-5.f90: Likewise.
* gfortran.dg/gomp/pr99928-6.f90: Likewise.
* gfortran.dg/gomp/pr99928-8.f90: Likewise.
* gfortran.dg/goacc/omp.f95: Use 'acc kernels loops' instead
of 'acc loops' to hide unrelated bug for now.
* gfortran.dg/goacc/omp-fixed.f: Likewise1 parent b7dd2e4 commit 178191e
File tree
22 files changed
+1497
-81
lines changed- gcc
- fortran
- testsuite/gfortran.dg
- goacc
- gomp
22 files changed
+1497
-81
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1718 | 1718 | | |
1719 | 1719 | | |
1720 | 1720 | | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
1721 | 1734 | | |
1722 | 1735 | | |
1723 | 1736 | | |
| |||
1896 | 1909 | | |
1897 | 1910 | | |
1898 | 1911 | | |
| 1912 | + | |
1899 | 1913 | | |
1900 | 1914 | | |
1901 | 1915 | | |
| |||
1905 | 1919 | | |
1906 | 1920 | | |
1907 | 1921 | | |
| 1922 | + | |
1908 | 1923 | | |
1909 | 1924 | | |
1910 | 1925 | | |
| |||
1924 | 1939 | | |
1925 | 1940 | | |
1926 | 1941 | | |
| 1942 | + | |
1927 | 1943 | | |
1928 | 1944 | | |
1929 | 1945 | | |
| |||
1934 | 1950 | | |
1935 | 1951 | | |
1936 | 1952 | | |
| 1953 | + | |
1937 | 1954 | | |
1938 | 1955 | | |
1939 | 1956 | | |
| |||
1948 | 1965 | | |
1949 | 1966 | | |
1950 | 1967 | | |
| 1968 | + | |
1951 | 1969 | | |
1952 | 1970 | | |
1953 | 1971 | | |
| |||
1977 | 1995 | | |
1978 | 1996 | | |
1979 | 1997 | | |
| 1998 | + | |
1980 | 1999 | | |
1981 | 2000 | | |
1982 | 2001 | | |
1983 | 2002 | | |
| 2003 | + | |
1984 | 2004 | | |
1985 | 2005 | | |
1986 | 2006 | | |
| |||
1997 | 2017 | | |
1998 | 2018 | | |
1999 | 2019 | | |
| 2020 | + | |
2000 | 2021 | | |
2001 | 2022 | | |
2002 | 2023 | | |
2003 | 2024 | | |
2004 | 2025 | | |
2005 | 2026 | | |
| 2027 | + | |
2006 | 2028 | | |
2007 | 2029 | | |
2008 | 2030 | | |
| |||
2012 | 2034 | | |
2013 | 2035 | | |
2014 | 2036 | | |
| 2037 | + | |
2015 | 2038 | | |
2016 | 2039 | | |
2017 | 2040 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5542 | 5542 | | |
5543 | 5543 | | |
5544 | 5544 | | |
| 5545 | + | |
5545 | 5546 | | |
5546 | 5547 | | |
5547 | 5548 | | |
| |||
5567 | 5568 | | |
5568 | 5569 | | |
5569 | 5570 | | |
| 5571 | + | |
5570 | 5572 | | |
5571 | 5573 | | |
5572 | 5574 | | |
| |||
5581 | 5583 | | |
5582 | 5584 | | |
5583 | 5585 | | |
| 5586 | + | |
5584 | 5587 | | |
5585 | 5588 | | |
5586 | 5589 | | |
5587 | 5590 | | |
5588 | 5591 | | |
5589 | 5592 | | |
| 5593 | + | |
5590 | 5594 | | |
5591 | 5595 | | |
5592 | 5596 | | |
5593 | 5597 | | |
5594 | 5598 | | |
5595 | 5599 | | |
5596 | 5600 | | |
| 5601 | + | |
5597 | 5602 | | |
5598 | 5603 | | |
5599 | 5604 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | | - | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
275 | 279 | | |
276 | 280 | | |
277 | 281 | | |
| |||
1401 | 1405 | | |
1402 | 1406 | | |
1403 | 1407 | | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
1404 | 1416 | | |
1405 | 1417 | | |
1406 | 1418 | | |
| |||
1421 | 1433 | | |
1422 | 1434 | | |
1423 | 1435 | | |
| 1436 | + | |
1424 | 1437 | | |
1425 | 1438 | | |
1426 | 1439 | | |
| |||
2717 | 2730 | | |
2718 | 2731 | | |
2719 | 2732 | | |
2720 | | - | |
| 2733 | + | |
| 2734 | + | |
2721 | 2735 | | |
2722 | 2736 | | |
2723 | 2737 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
| |||
176 | 177 | | |
177 | 178 | | |
178 | 179 | | |
| 180 | + | |
179 | 181 | | |
180 | 182 | | |
181 | 183 | | |
| |||
193 | 195 | | |
194 | 196 | | |
195 | 197 | | |
| 198 | + | |
196 | 199 | | |
197 | 200 | | |
198 | 201 | | |
199 | 202 | | |
200 | 203 | | |
201 | 204 | | |
| 205 | + | |
202 | 206 | | |
203 | 207 | | |
204 | 208 | | |
| |||
211 | 215 | | |
212 | 216 | | |
213 | 217 | | |
| 218 | + | |
214 | 219 | | |
215 | 220 | | |
216 | 221 | | |
| |||
0 commit comments