* [PATCH] PR fortran/77380
@ 2016-08-25 22:14 Steve Kargl
0 siblings, 0 replies; only message in thread
From: Steve Kargl @ 2016-08-25 22:14 UTC (permalink / raw)
To: fortran, gcc-patches
I plan to commit the following patch on Saturday if
no one objects in the next 40 or so hours.
2016-08-25 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77380
* dependency.c (gfc_check_dependency): Do not assert with
-fcoarray=lib.
2016-08-25 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77380
* gfortran.dg/pr77380.f90: New test.
Index: gcc/fortran/dependency.c
===================================================================
--- gcc/fortran/dependency.c (revision 239762)
+++ gcc/fortran/dependency.c (working copy)
@@ -1252,6 +1252,12 @@ gfc_check_dependency (gfc_expr *expr1, g
gfc_constructor *c;
int n;
+ /* -fcoarray=lib can end up here with expr1->expr_type set to EXPR_FUNCTION
+ and a reference to _F.caf_get, so skip the assert. */
+ if (expr1->expr_type == EXPR_FUNCTION
+ && strcmp (expr1->value.function.name, "_F.caf_get") == 0)
+ return 0;
+
gcc_assert (expr1->expr_type == EXPR_VARIABLE);
switch (expr2->expr_type)
Index: gcc/testsuite/gfortran.dg/pr77380.f90
===================================================================
--- gcc/testsuite/gfortran.dg/pr77380.f90 (nonexistent)
+++ gcc/testsuite/gfortran.dg/pr77380.f90 (working copy)
@@ -0,0 +1,6 @@
+! { dg-do compile }
+! { dg-options "-fcoarray=lib -O2" }
+program p
+ integer :: z(2)[*] = 1
+ z(:)[1] = z(:)[*] ! { dg-error "must be a scalar at" }
+end
--
Steve
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-08-25 22:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-25 22:14 [PATCH] PR fortran/77380 Steve Kargl
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).