aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2018-09-24 17:12:34 +0000
committerThomas Koenig <tkoenig@gcc.gnu.org>2018-09-24 17:12:34 +0000
commitc109362313623d83fe0a5194bceaf994cf0c6ce0 (patch)
treeac14daa4f39f5d214f1d6a049e704794f7aaabb3 /gcc
parent4afdfa37953f984fcfcc82fff93a3c04a7bd59a0 (diff)
downloadgcc-c109362313623d83fe0a5194bceaf994cf0c6ce0.zip
gcc-c109362313623d83fe0a5194bceaf994cf0c6ce0.tar.gz
gcc-c109362313623d83fe0a5194bceaf994cf0c6ce0.tar.bz2
re PR fortran/87397 (Clobbering intent(out) variables caused regression in OpenCoarrays testsuite)
2018-09-24 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/87397 * gfc_conv_procedure_call: Do not add clobber on INTENT(OUT) for variables in an associate statement. 2018-09-24 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/87401 * gfortran.dg/intent_out_12.f90: New test. From-SVN: r264539
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/trans-expr.c1
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/intent_out_12.f9023
4 files changed, 35 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 3901e29..5bc8856 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2018-09-24 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/87397
+ * gfc_conv_procedure_call: Do not add clobber on INTENT(OUT)
+ for variables in an associate statement.
+
2018-09-24 Bernhard Reuther-Fischer <aldot@gcc.gnu.org>
Cesar Philippidis <cesar@codesourcery.com>
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index b3808df..04210a4 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -5282,6 +5282,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
&& !e->symtree->n.sym->attr.dummy
/* FIXME - PR 87395 and PR 41453 */
&& e->symtree->n.sym->attr.save == SAVE_NONE
+ && !e->symtree->n.sym->attr.associate_var
&& e->ts.type != BT_CHARACTER && e->ts.type != BT_DERIVED
&& e->ts.type != BT_CLASS && !sym->attr.elemental;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b344f50..6e76e50 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2018-09-24 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/87401
+ * gfortran.dg/intent_out_12.f90: New test.
+
2018-09-24 Will Schmidt <will_schmidt@vnet.ibm.com>
PR testsuite/86952
diff --git a/gcc/testsuite/gfortran.dg/intent_out_12.f90 b/gcc/testsuite/gfortran.dg/intent_out_12.f90
new file mode 100644
index 0000000..e838bcb
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/intent_out_12.f90
@@ -0,0 +1,23 @@
+! { dg-do run }
+! PR fortran/87401 - this used to segfault at runtime.
+! Test case by Janus Weil.
+
+program assoc_intent_out
+
+ implicit none
+
+ real :: r
+
+ associate(o => r)
+ call sub(o)
+ end associate
+
+contains
+
+ subroutine sub(out)
+ real, intent(out) :: out
+ out = 0.0
+ end subroutine
+
+end
+