[Patch] Fortran/OpenMP: Support (parallel) master taskloop (simd) [PR99928]

2021-06-01 Thread Tobias Burnus

(PR 99928 is mainly about handling clauses in combined constructs.
but it sees some related commits like this one. The PR is not
fully fixed for C/C++ and for Fortran a bit more is missing.)

This patch adds '(parallel) master taskloop (simd)' support to gfortran.

For full parsing support for the Fortran version of the C/C++ testcases 
pr99928-*.c,
parsing support for 'loop' (+ combined constructs) and reduction with an array 
(slice)
is missing. – And, of course, doing FE fixes for handling the clauses,
similar to what has been/is being done for C/C++.
(No attempt has been made in this patch to fix long-standing
combined-clause handling issues.)

As bug fix, 'taskloop simd reduction(...)' is now supported and
'taskloop simd reduction(task,...' is now diagnosed by the FE.

Tobias

-
Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 München 
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Frank 
Thürauf
Fortran/OpenMP: Support (parallel) master taskloop (simd) [PR99928]

	PR middle-end/99928

gcc/fortran/ChangeLog:

	* dump-parse-tree.c (show_omp_node, show_code_node): Handle
	(parallel) master taskloop (simd).
	* frontend-passes.c (gfc_code_walker): Set in_omp_workshare
	to false for parallel master taskloop (simd).
	* gfortran.h (enum gfc_statement):
	Add ST_OMP_(END_)(PARALLEL_)MASTER_TASKLOOP(_SIMD).
	(enum gfc_exec_op): EXEC_OMP_(PARALLEL_)MASTER_TASKLOOP(_SIMD).
	* match.h (gfc_match_omp_master_taskloop,
	gfc_match_omp_master_taskloop_simd,
	gfc_match_omp_parallel_master_taskloop,
	gfc_match_omp_parallel_master_taskloop_simd): New prototype.
	* openmp.c (gfc_match_omp_parallel_master_taskloop,
	gfc_match_omp_parallel_master_taskloop_simd,
	gfc_match_omp_master_taskloop,
	gfc_match_omp_master_taskloop_simd): New.
	(gfc_match_omp_taskloop_simd): Permit 'reduction' clause.
	(resolve_omp_clauses): Handle new combined directives; remove
	inscan-reduction check to reduce multiple errors; add
	task-reduction error for 'taskloop simd'.
(gfc_resolve_omp_parallel_blocks,
	resolve_omp_do, omp_code_to_statement,
	gfc_resolve_omp_directive): Handle new combined constructs.
	* parse.c (decode_omp_directive, next_statement,
	gfc_ascii_statement, parse_omp_do, parse_omp_structured_block,
	parse_executable): Likewise.
	* resolve.c (gfc_resolve_blocks, gfc_resolve_code): Likewise.
	* st.c (gfc_free_statement): Likewise.
	* trans.c (trans_code): Likewise.
	* trans-openmp.c (gfc_split_omp_clauses,
	gfc_trans_omp_directive): Likewise.
	(gfc_trans_omp_parallel_master): Move after gfc_trans_omp_master_taskloop;
	handle parallel master taskloop (simd) as well.
	(gfc_trans_omp_taskloop): Take gfc_exec_op as arg.
	(gfc_trans_omp_master_taskloop): New.

gcc/testsuite/ChangeLog:

	* gfortran.dg/gomp/reduction5.f90: Remove dg-error the issue is
	now diagnosed with error output less. 
	* gfortran.dg/gomp/scan-1.f90: Likewise.
	* gfortran.dg/gomp/pr99928-3.f90: New test.
	* gfortran.dg/gomp/taskloop-1.f90: New test.

 gcc/fortran/dump-parse-tree.c |  12 +++
 gcc/fortran/frontend-passes.c |   2 +
 gcc/fortran/gfortran.h|  10 +-
 gcc/fortran/match.h   |   4 +
 gcc/fortran/openmp.c  |  85 ++--
 gcc/fortran/parse.c   |  73 +-
 gcc/fortran/resolve.c |  10 ++
 gcc/fortran/st.c  |   4 +
 gcc/fortran/trans-openmp.c| 112 -
 gcc/fortran/trans.c   |   4 +
 gcc/testsuite/gfortran.dg/gomp/pr99928-3.f90  | 139 ++
 gcc/testsuite/gfortran.dg/gomp/reduction5.f90 |   4 +-
 gcc/testsuite/gfortran.dg/gomp/scan-1.f90 |   4 +-
 gcc/testsuite/gfortran.dg/gomp/taskloop-1.f90 | 126 +++
 14 files changed, 550 insertions(+), 39 deletions(-)

 gcc/fortran/dump-parse-tree.c |  12 +++
 gcc/fortran/frontend-passes.c |   2 +
 gcc/fortran/gfortran.h|  10 +-
 gcc/fortran/match.h   |   4 +
 gcc/fortran/openmp.c  |  85 ++--
 gcc/fortran/parse.c   |  73 +-
 gcc/fortran/resolve.c |  10 ++
 gcc/fortran/st.c  |   4 +
 gcc/fortran/trans-openmp.c| 112 -
 gcc/fortran/trans.c   |   4 +
 gcc/testsuite/gfortran.dg/gomp/pr99928-3.f90  | 139 ++
 gcc/testsuite/gfortran.dg/gomp/reduction5.f90 |   4 +-
 gcc/testsuite/gfortran.dg/gomp/scan-1.f90 |   4 +-
 gcc/testsuite/gfortran.dg/gomp/taskloop-1.f90 | 126 +++
 14 files changed, 550 insertions(+), 39 deletions(-)

diff --git a/gcc/fortran/dump-parse-tree.c b/gcc/fortran/dump-parse-tree.c
index 93ff572cbd2..0e7fe1cc3f3 100644
--- a/gcc/fortran/dump-parse-tr

Re: [Patch] Fortran/OpenMP: Support (parallel) master taskloop (simd) [PR99928]

2021-06-01 Thread Jakub Jelinek via Fortran
On Tue, Jun 01, 2021 at 11:53:12AM +0200, Tobias Burnus wrote:
> Fortran/OpenMP: Support (parallel) master taskloop (simd) [PR99928]
> 
>   PR middle-end/99928
> 
> gcc/fortran/ChangeLog:
> 
>   * dump-parse-tree.c (show_omp_node, show_code_node): Handle
>   (parallel) master taskloop (simd).
>   * frontend-passes.c (gfc_code_walker): Set in_omp_workshare
>   to false for parallel master taskloop (simd).
>   * gfortran.h (enum gfc_statement):
>   Add ST_OMP_(END_)(PARALLEL_)MASTER_TASKLOOP(_SIMD).
>   (enum gfc_exec_op): EXEC_OMP_(PARALLEL_)MASTER_TASKLOOP(_SIMD).
>   * match.h (gfc_match_omp_master_taskloop,
>   gfc_match_omp_master_taskloop_simd,
>   gfc_match_omp_parallel_master_taskloop,
>   gfc_match_omp_parallel_master_taskloop_simd): New prototype.
>   * openmp.c (gfc_match_omp_parallel_master_taskloop,
>   gfc_match_omp_parallel_master_taskloop_simd,
>   gfc_match_omp_master_taskloop,
>   gfc_match_omp_master_taskloop_simd): New.
>   (gfc_match_omp_taskloop_simd): Permit 'reduction' clause.
>   (resolve_omp_clauses): Handle new combined directives; remove
>   inscan-reduction check to reduce multiple errors; add
>   task-reduction error for 'taskloop simd'.
> (gfc_resolve_omp_parallel_blocks,
>   resolve_omp_do, omp_code_to_statement,
>   gfc_resolve_omp_directive): Handle new combined constructs.
>   * parse.c (decode_omp_directive, next_statement,
>   gfc_ascii_statement, parse_omp_do, parse_omp_structured_block,
>   parse_executable): Likewise.
>   * resolve.c (gfc_resolve_blocks, gfc_resolve_code): Likewise.
>   * st.c (gfc_free_statement): Likewise.
>   * trans.c (trans_code): Likewise.
>   * trans-openmp.c (gfc_split_omp_clauses,
>   gfc_trans_omp_directive): Likewise.
>   (gfc_trans_omp_parallel_master): Move after 
> gfc_trans_omp_master_taskloop;
>   handle parallel master taskloop (simd) as well.
>   (gfc_trans_omp_taskloop): Take gfc_exec_op as arg.
>   (gfc_trans_omp_master_taskloop): New.
> 
> gcc/testsuite/ChangeLog:
> 
>   * gfortran.dg/gomp/reduction5.f90: Remove dg-error the issue is
>   now diagnosed with error output less. 

The above sentence is weird.  I'd expect semicolon or comma before the
and less error output instead of error output less.

>   * gfortran.dg/gomp/scan-1.f90: Likewise.
>   * gfortran.dg/gomp/pr99928-3.f90: New test.
>   * gfortran.dg/gomp/taskloop-1.f90: New test.

Otherwise LGTM.

Jakub



Re: [Patch] Fortran/OpenMP: Support (parallel) master taskloop (simd) [PR99928]

2021-06-01 Thread Tobias Burnus

On 01.06.21 12:02, Jakub Jelinek wrote:

 * gfortran.dg/gomp/scan-1.f90: Likewise.
 * gfortran.dg/gomp/pr99928-3.f90: New test.
 * gfortran.dg/gomp/taskloop-1.f90: New test.



Otherwise LGTM.
  Jakub


Thanks for the review! – I just saw that I missed to include another
testcase – unless there I comments, I will commit it later.

Tobias

-
Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 München 
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Frank 
Thürauf
Fortran/OpenMP: Add gfortran.dg/gomp/taskloop-2.f90 [PR99928]

	PR middle-end/99928

gcc/testsuite/ChangeLog

	* gfortran.dg/gomp/taskloop-2.f90: New.

diff --git a/gcc/testsuite/gfortran.dg/gomp/taskloop-2.f90 b/gcc/testsuite/gfortran.dg/gomp/taskloop-2.f90
new file mode 100644
index 000..21427623584
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/taskloop-2.f90
@@ -0,0 +1,72 @@
+subroutine foo()
+implicit none
+integer :: i, r
+!$omp taskloop reduction(task, +: r)  ! { dg-error "Only DEFAULT permitted as reduction-modifier in REDUCTION clause" }
+do i = 1, 64
+end do
+!$omp taskloop simd reduction(task, +: r)  ! { dg-error "Only DEFAULT permitted as reduction-modifier in REDUCTION clause" }
+do i = 1, 64
+end do
+!$omp master taskloop reduction(task, +: r)  ! { dg-error "Only DEFAULT permitted as reduction-modifier in REDUCTION clause" }
+do i = 1, 64
+end do
+!$omp master taskloop simd reduction(task, +: r)  ! { dg-error "Only DEFAULT permitted as reduction-modifier in REDUCTION clause" }
+do i = 1, 64
+end do
+!$omp parallel master taskloop reduction(task, +: r)  ! { dg-error "Only DEFAULT permitted as reduction-modifier in REDUCTION clause" }
+do i = 1, 64
+end do
+!$omp parallel master taskloop simd reduction(task, +: r)  ! { dg-error "Only DEFAULT permitted as reduction-modifier in REDUCTION clause" }
+do i = 1, 64
+end do
+
+!$omp taskloop reduction(inscan, +: r)  ! { dg-error "'inscan' REDUCTION clause on construct other than DO, SIMD, DO SIMD, PARALLEL DO, PARALLEL DO SIMD" }
+do i = 1, 64! { dg-error "OMP SCAN between two structured-block-sequences" "" { target *-*-* } .-1 }
+end do
+!$omp taskloop simd reduction(inscan, +: r)  ! { dg-error "'inscan' REDUCTION clause on construct other than DO, SIMD, DO SIMD, PARALLEL DO, PARALLEL DO SIMD" }
+do i = 1, 64 ! { dg-error "OMP SCAN between two structured-block-sequences" "" { target *-*-* } .-1 }
+end do
+!$omp master taskloop reduction(inscan, +: r) ! { dg-error "'inscan' REDUCTION clause on construct other than DO, SIMD, DO SIMD, PARALLEL DO, PARALLEL DO SIMD" }
+do i = 1, 64
+end do
+!$omp master taskloop simd reduction(inscan, +: r)  ! { dg-error "'inscan' REDUCTION clause on construct other than DO, SIMD, DO SIMD, PARALLEL DO, PARALLEL DO SIMD" }
+do i = 1, 64
+end do
+!$omp parallel master taskloop reduction(inscan, +: r)  ! { dg-error "'inscan' REDUCTION clause on construct other than DO, SIMD, DO SIMD, PARALLEL DO, PARALLEL DO SIMD" }
+do i = 1, 64 ! { dg-error "OMP SCAN between two structured-block-sequences" "" { target *-*-* } .-1 }
+end do
+!$omp parallel master taskloop simd reduction(inscan, +: r)   ! { dg-error "'inscan' REDUCTION clause on construct other than DO, SIMD, DO SIMD, PARALLEL DO, PARALLEL DO SIMD" }
+do i = 1, 64 ! { dg-error "OMP SCAN between two structured-block-sequences" "" { target *-*-* } .-1 }
+end do
+end
+
+
+subroutine bar()
+implicit none
+integer :: i, r
+r = 0
+!$omp parallel reduction(+:r)
+  !$omp master taskloop in_reduction(+:r)
+do i = 1, 64
+end do
+  !$omp master taskloop simd in_reduction(+:r)
+do i = 1, 64
+end do
+  !$omp master
+!$omp taskloop in_reduction(+:r)
+  do i = 1, 64
+  end do
+!$omp taskloop simd in_reduction(+:r)
+  do i = 1, 64
+  end do
+  !$omp end master
+!$omp end parallel
+
+!$omp parallel master taskloop in_reduction(+:r)  ! { dg-error "Failed to match clause" }
+do i = 1, 64
+end do
+
+!$omp parallel master taskloop simd in_reduction(+:r)  ! { dg-error "Failed to match clause" }
+do i = 1, 64
+end do
+end


Fwd: Update to GCC copyright assignment policy

2021-06-01 Thread Toon Moene

Hi All,

I know that most - if not all - of you do not follow the GCC Development 
 mailing list, so I'll forward the below message by the 
Steering Committee.


In short: For anyone on this mailing list who already contributes to 
gfortran and has a FSF copyright assignment, nothing changes.


Kind regards,
Toon.



 Forwarded Message 
Subject: Update to GCC copyright assignment policy
Date: Tue, 1 Jun 2021 10:00:06 -0400
From: David Edelsohn via Gcc 
Reply-To: David Edelsohn 
To: GCC Development 

GCC was created as part of the GNU Project but has grown to operate as
an autonomous project.

The GCC Steering Committee has decided to relax the requirement to
assign copyright for all changes to the Free Software Foundation.  GCC
will continue to be developed, distributed, and licensed under the GNU
General Public License v3.0. GCC will now accept contributions with or
without an FSF copyright assignment. This change is consistent with
the practices of many other major Free Software projects, such as the
Linux kernel.

Contributors who have an FSF Copyright Assignment don't need to
change anything.  Contributors who wish to utilize the Developer Certificate
of Origin[1] should add a Signed-off-by message to their commit messages.
Developers with commit access may add their name to the DCO list in the
MAINTAINERS file to certify the DCO for all future commits in lieu of 
individual

Signed-off-by messages for each commit.

The GCC Steering Committee continues to affirm the principles of Free
Software, and that will never change.

- The GCC Steering Committee

[1] https://developercertificate.org/


Requesting Inputs : Anonymous Survey for Developer Tools

2021-06-01 Thread Dev Survey via Fortran
Dear All, 
I have attached a survey form so that I can better understand what kind of 
tools developers like to have to facilitate their workflows on a day to day 
basis. 
No login required or identifiable information collection and is a completely 
anonymous survey, and takes no more than 5-10 minutes. 
 Developer Tools Survey

To confirm this is not spam, please check via : https://www.phishtank.com/
Shortened URL : https://forms.gle/vTrFNUhfFcqznSRr9
Full URL : 
https://docs.google.com/forms/d/e/1FAIpQLSePzAwRUsem1wunWWtXr_FoX2viruIfoyb744zGufX5jBxH8A/viewform?usp=sf_link
Thanks,Fellow Developer