+2022-10-05 Tobias Burnus <tobias@codesourcery.com>
+
+ Backport from mainline:
+ 2022-10-04 Tobias Burnus <tobias@codesourcery.com>
+
+ * doc/invoke.texi (-fopenmp): Mention C++ attribut syntax.
+ (-fopenmp-simd): Likewise; update permitted directives.
+
2022-10-05 Tobias Burnus <tobias@codesourcery.com>
Backport from mainline:
@item -fopenmp
@opindex fopenmp
@cindex OpenMP parallel
-Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
+Enable handling of OpenMP directives @code{#pragma omp} in C/C++,
+@code{[[omp::directive(...)]]} and @code{[[omp::sequence(...)]]} in C++ and
@code{!$omp} in Fortran. When @option{-fopenmp} is specified, the
compiler generates parallel code according to the OpenMP Application
Program Interface v4.5 @w{@uref{https://www.openmp.org}}. This option
@opindex fopenmp-simd
@cindex OpenMP SIMD
@cindex SIMD
-Enable handling of OpenMP's SIMD directives with @code{#pragma omp}
-in C/C++ and @code{!$omp} in Fortran. Other OpenMP directives
-are ignored.
+Enable handling of OpenMP's @code{simd}, @code{declare simd},
+@code{declare reduction}, @code{assume}, @code{ordered}, @code{scan},
+@code{loop} directives and combined or composite directives with
+@code{simd} as constituent with @code{#pragma omp} in C/C++,
+@code{[[omp::directive(...)]]} and @code{[[omp::sequence(...)]]} in C++
+and @code{!$omp} in Fortran. Other OpenMP directives are ignored.
@item -fopenmp-target-simd-clone
@opindex fopenmp-target-simd-clone
+2022-10-05 Tobias Burnus <tobias@codesourcery.com>
+
+ Backport from mainline:
+ 2022-10-04 Tobias Burnus <tobias@codesourcery.com>
+
+ * parse.cc (decode_omp_directive): Handle '(end) loop' and 'scan'
+ also with -fopenmp-simd.
+
2022-09-30 Tobias Burnus <tobias@codesourcery.com>
Backport from mainline:
matcho ("end distribute", gfc_match_omp_eos_error, ST_OMP_END_DISTRIBUTE);
matchs ("end do simd", gfc_match_omp_end_nowait, ST_OMP_END_DO_SIMD);
matcho ("end do", gfc_match_omp_end_nowait, ST_OMP_END_DO);
- matcho ("end loop", gfc_match_omp_eos_error, ST_OMP_END_LOOP);
+ matchs ("end loop", gfc_match_omp_eos_error, ST_OMP_END_LOOP);
matchs ("end simd", gfc_match_omp_eos_error, ST_OMP_END_SIMD);
matcho ("end masked taskloop simd", gfc_match_omp_eos_error,
ST_OMP_END_MASKED_TASKLOOP_SIMD);
matcho ("nothing", gfc_match_omp_nothing, ST_NONE);
break;
case 'l':
- matcho ("loop", gfc_match_omp_loop, ST_OMP_LOOP);
+ matchs ("loop", gfc_match_omp_loop, ST_OMP_LOOP);
break;
case 'o':
if (gfc_match ("ordered depend (") == MATCH_YES
matcho ("requires", gfc_match_omp_requires, ST_OMP_REQUIRES);
break;
case 's':
- matcho ("scan", gfc_match_omp_scan, ST_OMP_SCAN);
+ matchs ("scan", gfc_match_omp_scan, ST_OMP_SCAN);
matcho ("scope", gfc_match_omp_scope, ST_OMP_SCOPE);
matcho ("sections", gfc_match_omp_sections, ST_OMP_SECTIONS);
matcho ("section", gfc_match_omp_eos_error, ST_OMP_SECTION);
+2022-10-05 Tobias Burnus <tobias@codesourcery.com>
+
+ Backport from mainline:
+ 2022-10-04 Tobias Burnus <tobias@codesourcery.com>
+
+ * gfortran.dg/gomp/openmp-simd-7.f90: New test.
+
2022-10-04 Tobias Burnus <tobias@codesourcery.com>
Backport from mainline:
--- /dev/null
+! { dg-options "-fno-openmp -fopenmp-simd -fdump-tree-original" }
+
+subroutine foo (a, b)
+ integer, contiguous :: a(:), b(:)
+ integer :: i
+ !$omp simd reduction (inscan, +:r)
+ do i = 1, 1024
+ r = r + a(i)
+ !$omp scan inclusive(r)
+ b(i) = r
+ end do
+ !$omp end simd
+
+ !$omp loop
+ do i = 1, 1024
+ a(i) = a(i) + i
+ end do
+ !$omp end loop
+end
+
+! { dg-final { scan-tree-dump "#pragma omp simd linear\\(i:1\\) reduction\\(inscan,\\+:r\\)" "original" } }
+! { dg-final { scan-tree-dump "#pragma omp scan inclusive\\(r\\)" "original" } }
+! { dg-final { scan-tree-dump "#pragma omp loop" "original" } }