Commit de517e64 by Andre Vehreschild

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
parent 43b9f499
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
......
......@@ -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);
......
2016-04-04 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/65795
* gfortran.dg/coarray_allocate_6.f08: New test.
2016-04-04 Richard Biener <rguenther@suse.de>
PR rtl-optimization/70484
......
! { dg-do run }
! { dg-options "-fcoarray=single -fdump-tree-original" }
! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
! Test fix for pr65795.
implicit none
type t2
integer, allocatable :: x
end type t2
type t3
type(t2), allocatable :: caf[:]
end type t3
!type(t3), save, target :: c, d
type(t3), target :: c, d
integer :: stat
allocate(c%caf[*], stat=stat)
end
! Besides checking that the executable does not crash anymore, check
! that the cause has been remove.
! { dg-final { scan-tree-dump-not "c.caf.x = 0B" "original" } }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment