Hi! On Thu, 5 Nov 2015 18:10:49 -0800, Cesar Philippidis <ce...@codesourcery.com> wrote: > I've applied this patch to trunk. It also includes the fortran and > template changes. [...]
> Also, because of these reduction problems, I decided not to merge > combined_loops.f90 with combined-directives.f90 yet because the latter > relies on scanning which would fail with the errors detected during > gimplfication. I'm planning on adding a couple of more test cases [...] ACK. Merging Cesar's trunk r229832 into gomp-4_0-branch, I tried to replicate this part of his commit: > --- a/gcc/fortran/trans-openmp.c > +++ b/gcc/fortran/trans-openmp.c > @@ -3449,16 +3478,33 @@ gfc_trans_oacc_combined_directive (gfc_code *code) > [...] > + loop_clauses.lists[OMP_LIST_PRIVATE] > + = construct_clauses.lists[OMP_LIST_PRIVATE]; > + loop_clauses.lists[OMP_LIST_REDUCTION] > + = construct_clauses.lists[OMP_LIST_REDUCTION]; > [...] > + construct_clauses.lists[OMP_LIST_PRIVATE] = NULL; > [...] ... in the gcc/fortran/trans-openmp.c:gfc_filter_oacc_combined_clauses function that we're using on gomp-4_0-branch, but ran into ICEs that looked like "double free" (or similar; maybe related to the slightly different structure of this code due to device_type support), so applied the following hack and XFAILs as part of the merge, which needs to be resolved later (on gomp-4_0-branch). (A few related TODOs also remain to be addressed in gcc/testsuite/c-c++-common/goacc/combined-directives.c.) --- gcc/fortran/trans-openmp.c +++ gcc/fortran/trans-openmp.c @@ -3691,12 +3691,14 @@ gfc_filter_oacc_combined_clauses (gfc_omp_clauses **orig_clauses, (*orig_clauses)->tile = false; (*loop_clauses)->tile_list = (*orig_clauses)->tile_list; (*orig_clauses)->tile_list = NULL; {+#if 0 /* TODO */+} (*loop_clauses)->lists[OMP_LIST_PRIVATE] = (*orig_clauses)->lists[OMP_LIST_PRIVATE]; (*orig_clauses)->lists[OMP_LIST_PRIVATE] = NULL; (*loop_clauses)->lists[OMP_LIST_REDUCTION] = (*orig_clauses)->lists[OMP_LIST_REDUCTION]; /* Don't reset (*orig_clauses)->lists[OMP_LIST_REDUCTION]. */ {+#endif+} (*loop_clauses)->device_types = (*orig_clauses)->device_types; --- gcc/testsuite/gfortran.dg/goacc/combined-directives.f90 +++ gcc/testsuite/gfortran.dg/goacc/combined-directives.f90 @@ -4,6 +4,9 @@ ! { dg-options "-fopenacc -fdump-tree-gimple" } ! TODO {+! Fix OMP_LIST_PRIVATE and OMP_LIST_REDUCTION splitting in+} {+! gcc/fortran/trans-openmp.c:gfc_filter_oacc_combined_clauses, and remove tree+} {+! scanning XFAILs.+} ! Enable and update tree scanning for reduction clauses. ! Enable/add/update device_type clauses and tree scanning. @@ -154,12 +157,12 @@ subroutine test ! !$acc end kernels loop end subroutine test ! { dg-final { scan-tree-dump-times "acc loop private.i. private.j. collapse.2." 2 "gimple" {+{ xfail *-*-* }+} } } ! { dg-final { scan-tree-dump-times "acc loop private.i. gang" 2 "gimple" {+{ xfail *-*-* }+} } } ! { dg-final { scan-tree-dump-times "acc loop private.i. private.j. worker" 2 "gimple" {+{ xfail *-*-* }+} } } ! { dg-final { scan-tree-dump-times "acc loop private.i. private.j. vector" 2 "gimple" {+{ xfail *-*-* }+} } } ! { dg-final { scan-tree-dump-times "acc loop private.i. private.j. seq" 2 "gimple" {+{ xfail *-*-* }+} } } ! { dg-final { scan-tree-dump-times "acc loop private.i. private.j. auto" 2 "gimple" {+{ xfail *-*-* }+} } } ! { dg-final { scan-tree-dump-times "acc loop private.i. private.j. tile.2, 3" 2 "gimple" {+{ xfail *-*-* }+} } } ! { dg-final { scan-tree-dump-times "acc loop private.i. independent" 2 "gimple" {+{ xfail *-*-* }+} } } ! { dg-final { scan-tree-dump-times "private.z" 2 "gimple" } } With that, committed to gomp-4_0-branch in r230012: commit 80ebc1e747e3422e0cc57c4c11387ec26bbf8814 Merge: 175e08b ef014f9 Author: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Mon Nov 9 11:10:12 2015 +0000 svn merge -r 229831:229832 svn+ssh://gcc.gnu.org/svn/gcc/trunk git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@230012 138bc75d-0d04-0410-961f-82ee72b054a4 Grüße Thomas
signature.asc
Description: PGP signature