From: Andre Vehreschild <vehre@gmx.de>
To: Jerry DeLisle <jvdelisle@charter.net>
Cc: GCC-Patches-ML <gcc-patches@gcc.gnu.org>,
GCC-Fortran-ML <fortran@gcc.gnu.org>
Subject: Re: [Patch, Fortran, pr85507, v1] Modell variable dependencies in coarray expression correctly.
Date: Sun, 06 May 2018 12:43:00 -0000 [thread overview]
Message-ID: <20180506144333.39e0b7f0@vepi2> (raw)
In-Reply-To: <21250f24-5e06-d3a2-a17d-ade84e7c584d@charter.net>
[-- Attachment #1: Type: text/plain, Size: 956 bytes --]
Hi Jerry,
thanks for the review. Applied to
trunk as r259974
gcc-8 as r259979
gcc-7 as r259977, and
gcc-6 as r259978.
The diffs for trunk to gcc-7 are merely the same and given as submit.diff only.
The diff for gcc-6 has some small adaptions in a testcase and is therefore
attached separately.
Regards,
Andre
On Sat, 5 May 2018 09:38:08 -0700
Jerry DeLisle <jvdelisle@charter.net> wrote:
> On 04/30/2018 01:52 AM, Andre Vehreschild wrote:
> > Hi all,
> >
> > attached patch partially reverts r259385 preventing an ICE. At the same time
> > the check_dependency routine is parameterized correctly so that variable
> > dependencies in coarray expressions are determined more precisely.
> >
> > Bootstrapped and regtested ok on x86_64-linux-gnu/f27. Ok for trunk,
> > gcc-8/-7/-6?
> >
> > Regards,
> > Andre
> >
>
> Yes, OK, assuming also all OpenCoarrays test cases also pass.
>
> Jerry
--
Andre Vehreschild * Email: vehre ad gmx dot de
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: submit.diff --]
[-- Type: text/x-patch, Size: 5062 bytes --]
Index: gcc/testsuite/gfortran.dg/coarray_lib_comm_1.f90
===================================================================
--- gcc/testsuite/gfortran.dg/coarray_lib_comm_1.f90 (Revision 259973)
+++ gcc/testsuite/gfortran.dg/coarray_lib_comm_1.f90 (Arbeitskopie)
@@ -38,9 +38,8 @@
if (any (A-B /= 0)) STOP 4
end
-! { dg-final { scan-tree-dump-times "_gfortran_caf_get \\\(caf_token.0, \\\(integer\\\(kind=\[48\]\\\)\\\) parm.\[0-9\]+.data - \\\(integer\\\(kind=\[48\]\\\)\\\) a, 1, &parm.\[0-9\]+, 0B, &parm.\[0-9\]+, 4, 4, 0, 0B\\\);" 1 "original" } }
-! { dg-final { scan-tree-dump-times "_gfortran_caf_get \\\(caf_token.0, \\\(integer\\\(kind=\[48\]\\\)\\\) parm.\[0-9\]+.data - \\\(integer\\\(kind=\[48\]\\\)\\\) a, 1, &parm.\[0-9\]+, 0B, &parm.\[0-9\]+, 4, 4, 1, 0B\\\);" 1 "original" } }
+! { dg-final { scan-tree-dump-times "_gfortran_caf_get \\\(caf_token.0, \\\(integer\\\(kind=\[48\]\\\)\\\) parm.\[0-9\]+.data - \\\(integer\\\(kind=\[48\]\\\)\\\) a, 1, &parm.\[0-9\]+, 0B, &parm.\[0-9\]+, 4, 4, 1, 0B\\\);" 2 "original" } }
! { dg-final { scan-tree-dump-times "_gfortran_caf_get \\\(caf_token.0, \\\(integer\\\(kind=\[48\]\\\)\\\) parm.\[0-9\]+.data - \\\(integer\\\(kind=\[48\]\\\)\\\) a, 1, &parm.\[0-9\]+, 0B, &p, 4, 4, 1, 0B\\\);" 1 "original" } }
! { dg-final { scan-tree-dump-times "_gfortran_caf_get \\\(caf_token.1, \\\(integer\\\(kind=\[48\]\\\)\\\) parm.\[0-9\]+.data - \\\(integer\\\(kind=\[48\]\\\)\\\) b, 1, &parm.\[0-9\]+, 0B, &p, 4, 4, 0, 0B\\\);" 1 "original" } }
-! { dg-final { scan-tree-dump-times "_gfortran_caf_sendget \\\(caf_token.0, \\\(integer\\\(kind=\[48\]\\\)\\\) parm.\[0-9\]+.data - \\\(integer\\\(kind=\[48\]\\\)\\\) a, 1, &parm.\[0-9\]+, 0B, caf_token.0, \\\(integer\\\(kind=\[48\]\\\)\\\) parm.\[0-9\]+.data - \\\(integer\\\(kind=\[48\]\\\)\\\) a, 1, &parm.\[0-9\]+, 0B, 4, 4, 0, 0B\\\);" 1 "original" } }
+! { dg-final { scan-tree-dump-times "_gfortran_caf_sendget \\\(caf_token.0, \\\(integer\\\(kind=\[48\]\\\)\\\) parm.\[0-9\]+.data - \\\(integer\\\(kind=\[48\]\\\)\\\) a, 1, &parm.\[0-9\]+, 0B, caf_token.0, \\\(integer\\\(kind=\[48\]\\\)\\\) parm.\[0-9\]+.data - \\\(integer\\\(kind=\[48\]\\\)\\\) a, 1, &parm.\[0-9\]+, 0B, 4, 4, 1, 0B\\\);" 1 "original" } }
Index: gcc/testsuite/gfortran.dg/coarray_dependency_1.f90
===================================================================
--- gcc/testsuite/gfortran.dg/coarray_dependency_1.f90 (nicht existent)
+++ gcc/testsuite/gfortran.dg/coarray_dependency_1.f90 (Revision 259974)
@@ -0,0 +1,11 @@
+! { dg-do compile }
+! { dg-options "-fcoarray=lib -lcaf_single" }
+!
+! Check that reffing x on both sides of a coarray send does not ICE.
+! PR 85507
+
+program check_dependency
+ integer :: x[*]
+ x[42] = x
+end program check_dependency
+
Index: gcc/testsuite/ChangeLog
===================================================================
--- gcc/testsuite/ChangeLog (Revision 259973)
+++ gcc/testsuite/ChangeLog (Arbeitskopie)
@@ -1,3 +1,9 @@
+2018-05-06 Andre Vehreschild <vehre@gcc.gnu.org>
+
+ PR fortran/85507
+ * gfortran.dg/coarray_dependency_1.f90: New test.
+ * gfortran.dg/coarray_lib_comm_1.f90: Fix counting caf-expressions.
+
2018-05-04 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
* testsuite/brig.dg/test/gimple/smoke_test.hsail: Fix the test
Index: gcc/fortran/dependency.c
===================================================================
--- gcc/fortran/dependency.c (Revision 259973)
+++ gcc/fortran/dependency.c (Arbeitskopie)
@@ -2238,9 +2238,8 @@
break;
/* Exactly matching and forward overlapping ranges don't cause a
- dependency, when they are not part of a coarray ref. */
- if (fin_dep < GFC_DEP_BACKWARD
- && lref->u.ar.codimen == 0 && rref->u.ar.codimen == 0)
+ dependency. */
+ if (fin_dep < GFC_DEP_BACKWARD)
return 0;
/* Keep checking. We only have a dependency if
Index: gcc/fortran/trans-intrinsic.c
===================================================================
--- gcc/fortran/trans-intrinsic.c (Revision 259973)
+++ gcc/fortran/trans-intrinsic.c (Arbeitskopie)
@@ -1860,7 +1860,7 @@
lhs_expr = code->ext.actual->expr;
rhs_expr = code->ext.actual->next->expr;
- may_require_tmp = gfc_check_dependency (lhs_expr, rhs_expr, false) == 0
+ may_require_tmp = gfc_check_dependency (lhs_expr, rhs_expr, true) == 0
? boolean_false_node : boolean_true_node;
gfc_init_block (&block);
Index: gcc/fortran/ChangeLog
===================================================================
--- gcc/fortran/ChangeLog (Revision 259973)
+++ gcc/fortran/ChangeLog (Arbeitskopie)
@@ -1,3 +1,11 @@
+2018-05-06 Andre Vehreschild <vehre@gcc.gnu.org>
+
+ PR fortran/85507
+ * dependency.c (gfc_dep_resolver): Revert looking at coarray dimension
+ introduced by r259385.
+ * trans-intrinsic.c (conv_caf_send): Always report a dependency for
+ same variables in coarray assignments.
+
2018-05-02 Tom de Vries <tom@codesourcery.com>
PR libgomp/82428
[-- Attachment #3: submit-6.diff --]
[-- Type: text/x-patch, Size: 4929 bytes --]
Index: gcc/fortran/ChangeLog
===================================================================
--- gcc/fortran/ChangeLog (Revision 259977)
+++ gcc/fortran/ChangeLog (Arbeitskopie)
@@ -1,3 +1,12 @@
+2018-05-06 Andre Vehreschild <vehre@gcc.gnu.org>
+
+ PR fortran/85507
+ Backport from trunk.
+ * dependency.c (gfc_dep_resolver): Revert looking at coarray dimension
+ introduced by r259385.
+ * trans-intrinsic.c (conv_caf_send): Always report a dependency for
+ same variables in coarray assignments.
+
2018-04-28 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/81773
Index: gcc/fortran/dependency.c
===================================================================
--- gcc/fortran/dependency.c (Revision 259977)
+++ gcc/fortran/dependency.c (Arbeitskopie)
@@ -2239,9 +2239,8 @@
break;
/* Exactly matching and forward overlapping ranges don't cause a
- dependency, when they are not part of a coarray ref. */
- if (fin_dep < GFC_DEP_BACKWARD
- && lref->u.ar.codimen == 0 && rref->u.ar.codimen == 0)
+ dependency. */
+ if (fin_dep < GFC_DEP_BACKWARD)
return 0;
/* Keep checking. We only have a dependency if
Index: gcc/fortran/trans-intrinsic.c
===================================================================
--- gcc/fortran/trans-intrinsic.c (Revision 259977)
+++ gcc/fortran/trans-intrinsic.c (Arbeitskopie)
@@ -1249,7 +1249,7 @@
lhs_expr = code->ext.actual->expr;
rhs_expr = code->ext.actual->next->expr;
- may_require_tmp = gfc_check_dependency (lhs_expr, rhs_expr, false) == 0
+ may_require_tmp = gfc_check_dependency (lhs_expr, rhs_expr, true) == 0
? boolean_false_node : boolean_true_node;
gfc_init_block (&block);
Index: gcc/testsuite/ChangeLog
===================================================================
--- gcc/testsuite/ChangeLog (Revision 259977)
+++ gcc/testsuite/ChangeLog (Arbeitskopie)
@@ -1,3 +1,10 @@
+2018-05-06 Andre Vehreschild <vehre@gcc.gnu.org>
+
+ PR fortran/85507
+ Backport from trunk.
+ * gfortran.dg/coarray_dependency_1.f90: New test.
+ * gfortran.dg/coarray_lib_comm_1.f90: Fix counting caf-expressions.
+
2018-04-28 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/81773
Index: gcc/testsuite/gfortran.dg/coarray_dependency_1.f90
===================================================================
--- gcc/testsuite/gfortran.dg/coarray_dependency_1.f90 (nicht existent)
+++ gcc/testsuite/gfortran.dg/coarray_dependency_1.f90 (Arbeitskopie)
@@ -0,0 +1,11 @@
+! { dg-do compile }
+! { dg-options "-fcoarray=lib -lcaf_single" }
+!
+! Check that reffing x on both sides of a coarray send does not ICE.
+! PR 85507
+
+program check_dependency
+ integer :: x[*]
+ x[42] = x
+end program check_dependency
+
Index: gcc/testsuite/gfortran.dg/coarray_lib_comm_1.f90
===================================================================
--- gcc/testsuite/gfortran.dg/coarray_lib_comm_1.f90 (Revision 259977)
+++ gcc/testsuite/gfortran.dg/coarray_lib_comm_1.f90 (Arbeitskopie)
@@ -38,9 +38,8 @@
if (any (A-B /= 0)) call abort
end
-! { dg-final { scan-tree-dump-times "_gfortran_caf_get \\\(caf_token.0, \\\(integer\\\(kind=\[48\]\\\)\\\) parm.\[0-9\]+.data - \\\(integer\\\(kind=\[48\]\\\)\\\) a, 1, &parm.\[0-9\]+, 0B, &parm.\[0-9\]+, 4, 4, 0\\\);" 1 "original" } }
-! { dg-final { scan-tree-dump-times "_gfortran_caf_get \\\(caf_token.0, \\\(integer\\\(kind=\[48\]\\\)\\\) parm.\[0-9\]+.data - \\\(integer\\\(kind=\[48\]\\\)\\\) a, 1, &parm.\[0-9\]+, 0B, &parm.\[0-9\]+, 4, 4, 1\\\);" 1 "original" } }
+! { dg-final { scan-tree-dump-times "_gfortran_caf_get \\\(caf_token.0, \\\(integer\\\(kind=\[48\]\\\)\\\) parm.\[0-9\]+.data - \\\(integer\\\(kind=\[48\]\\\)\\\) a, 1, &parm.\[0-9\]+, 0B, &parm.\[0-9\]+, 4, 4, 1\\\);" 2 "original" } }
! { dg-final { scan-tree-dump-times "_gfortran_caf_get \\\(caf_token.0, \\\(integer\\\(kind=\[48\]\\\)\\\) parm.\[0-9\]+.data - \\\(integer\\\(kind=\[48\]\\\)\\\) a, 1, &parm.\[0-9\]+, 0B, &p, 4, 4, 1\\\);" 1 "original" } }
! { dg-final { scan-tree-dump-times "_gfortran_caf_get \\\(caf_token.1, \\\(integer\\\(kind=\[48\]\\\)\\\) parm.\[0-9\]+.data - \\\(integer\\\(kind=\[48\]\\\)\\\) b, 1, &parm.\[0-9\]+, 0B, &p, 4, 4, 0\\\);" 1 "original" } }
-! { dg-final { scan-tree-dump-times "_gfortran_caf_sendget \\\(caf_token.0, \\\(integer\\\(kind=\[48\]\\\)\\\) parm.\[0-9\]+.data - \\\(integer\\\(kind=\[48\]\\\)\\\) a, 1, &parm.\[0-9\]+, 0B, caf_token.0, \\\(integer\\\(kind=\[48\]\\\)\\\) parm.\[0-9\]+.data - \\\(integer\\\(kind=\[48\]\\\)\\\) a, 1, &parm.\[0-9\]+, 0B, 4, 4, 0\\\);" 1 "original" } }
+! { dg-final { scan-tree-dump-times "_gfortran_caf_sendget \\\(caf_token.0, \\\(integer\\\(kind=\[48\]\\\)\\\) parm.\[0-9\]+.data - \\\(integer\\\(kind=\[48\]\\\)\\\) a, 1, &parm.\[0-9\]+, 0B, caf_token.0, \\\(integer\\\(kind=\[48\]\\\)\\\) parm.\[0-9\]+.data - \\\(integer\\\(kind=\[48\]\\\)\\\) a, 1, &parm.\[0-9\]+, 0B, 4, 4, 1\\\);" 1 "original" } }
prev parent reply other threads:[~2018-05-06 12:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-30 10:16 Andre Vehreschild
2018-05-05 16:38 ` Jerry DeLisle
2018-05-06 12:43 ` Andre Vehreschild [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180506144333.39e0b7f0@vepi2 \
--to=vehre@gmx.de \
--cc=fortran@gcc.gnu.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=jvdelisle@charter.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).