aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorAndre Vehreschild <vehre@gcc.gnu.org>2016-04-04 11:32:28 +0200
committerAndre Vehreschild <vehre@gcc.gnu.org>2016-04-04 11:32:28 +0200
commitde517e644a374f7df40bf0b43254684dab717ac0 (patch)
tree0359da9c7ee2fde9145b6988e87491fb19e9ceb8 /gcc/fortran
parent43b9f499103ccebb9ce00e7c62e11da54334e63a (diff)
downloadgcc-de517e644a374f7df40bf0b43254684dab717ac0.zip
gcc-de517e644a374f7df40bf0b43254684dab717ac0.tar.gz
gcc-de517e644a374f7df40bf0b43254684dab717ac0.tar.bz2
re PR fortran/65795 (Segfault (invalid write) for ALLOCATE statement involving COARRAYS)
gcc/fortran/ChangeLog: 2016-04-04 Andre Vehreschild <vehre@gcc.gnu.org> PR fortran/65795 * trans-array.c (gfc_array_allocate): When the array is a coarray, do not nullyfing its allocatable components in array_allocate, because the nullify missed the array ref and nullifies the wrong component. Cosmetics. gcc/testsuite/ChangeLog: 2016-04-04 Andre Vehreschild <vehre@gcc.gnu.org> PR fortran/65795 * gfortran.dg/coarray_allocate_6.f08: New test. From-SVN: r234710
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog8
-rw-r--r--gcc/fortran/trans-array.c4
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 5ab7d3f..88ac1cc 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,11 @@
+2016-04-04 Andre Vehreschild <vehre@gcc.gnu.org>
+
+ PR fortran/65795
+ * trans-array.c (gfc_array_allocate): When the array is a coarray,
+ do not nullyfing its allocatable components in array_allocate, because
+ the nullify missed the array ref and nullifies the wrong component.
+ Cosmetics.
+
2016-03-29 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/70397
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 649b80f..825dfb8 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -5550,8 +5550,8 @@ gfc_array_allocate (gfc_se * se, gfc_expr * expr, tree status, tree errmsg,
else
gfc_add_expr_to_block (&se->pre, set_descriptor);
- if ((expr->ts.type == BT_DERIVED)
- && expr->ts.u.derived->attr.alloc_comp)
+ if (expr->ts.type == BT_DERIVED && expr->ts.u.derived->attr.alloc_comp
+ && !coarray)
{
tmp = gfc_nullify_alloc_comp (expr->ts.u.derived, se->expr,
ref->u.ar.as->rank);