Re: [Patch] OpenMP: Fortran + ME - update for spatial dimensions + message clause

Jakub Jelinek <[email protected]> Tue, 28 Jul 2026 18:40:48 +0200
Newsgroups gmane.comp.gcc.patches,gmane.comp.gcc.fortran
Message-ID <amjbkEvoDcBktNro@tucnak>
On Mon, Jul 27, 2026 at 10:29:47AM +0200, Tobias Burnus wrote:
> Not yet implemented: C/C++ parser support (once done, some tree-usage
> cleanup can be done) nor actually passing anything to the runtime
> library.
> 	* gfortran.dg/gomp/spatial-dimensions-5.f90: New test.

This test causes many UNRESOLVED cases.

> --- /dev/null
> +++ b/gcc/testsuite/gfortran.dg/gomp/spatial-dimensions-5.f90
> @@ -0,0 +1,84 @@
> +! { dg-do compile }
> +! { dg-additional-options "-fdump-tree-gimple" }

We dump gimple.

> +subroutine sub(x)
> +implicit none
> +integer :: x, i
> +
> +!$omp target teams distribute parallel do num_teams(11 : 22) thread_limit(strict,dims(3) : 11,12,13) num_threads(relaxed: 23,45,53) message("first") severity(warning)
> +do i = 1,1
> +  x = 0
> +end do
> +! { dg-final { scan-tree-dump-times "#pragma omp target num_teams\\(-1\\) message\\(.first. \\\[len:5\\\]\\) severity\\(warning\\) thread_limit\\(strict,dims\\(\\):11, 12, 13\\) firstprivate\\(x\\)" 1 "omplower" } }
> +! { dg-final { scan-tree-dump-times "#pragma omp teams num_teams\\(11, 22\\) thread_limit\\(strict,dims\\(\\):11, 12, 13\\) message\\(.first. \\\[len:5\\\]\\) severity\\(warning\\) shared\\(x\\)" 1 "omplower" } }
> +! { dg-final { scan-tree-dump-times "#pragma omp parallel message\\(.first. \\\[len:5\\\]\\) severity\\(warning\\) num_threads\\(23, 45, 53\\) shared\\(x\\)" 1 "omplower" } }
> +end
> +
> +! { dg-message "sorry, unimplemented: 'num_threads' clause with more than one argument" "" { target *-*-* } 8 }
> +! { dg-message "sorry, unimplemented: 'message' clause" "" { target *-*-* } 8 }
> +! { dg-message "sorry, unimplemented: 'thread_limit' clause with 'dims' modifier" "" { target *-*-* } 8 }

Emit a sorry.

But then look for all the tree dump matches in omplower dump which is not
emitted.
Changing omplower to gimple fixes most of it, there are 2 dg-final FAILs
after that.
Or if you want to scan in omplower, add -fdump-tree-gimple and xfail those
messages, or run them on { target nonexistent-*-* } or something similar.

	Jakub