Commit 467f18f3 by Paul Thomas

re PR fortran/29371 (Coredump when using -fbounds-check with pointer & nullify)

2006-10-14 Paul Thomas <pault@gcc.gnu.org>

	PR fortran/29371
	* trans-expr.c (gfc_trans_pointer_assignment): Add the expression
	for the assignment of null to the data field to se->pre, rather
	than block.	

2006-10-14 Paul Thomas <pault@gcc.gnu.org>

	PR fortran/29371
	* gfortran.dg/nullify_3.f90: New test.

From-SVN: r117732
parent 621048c8
2006-10-14 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29371
* trans-expr.c (gfc_trans_pointer_assignment): Add the expression
for the assignment of null to the data field to se->pre, rather
than block.
2006-10-14 Kazu Hirata <kazu@codesourcery.com>
* intrinsic.texi: Fix typos.
......
......@@ -3149,7 +3149,7 @@ gfc_trans_pointer_assignment (gfc_expr * expr1, gfc_expr * expr2)
{
case EXPR_NULL:
/* Just set the data pointer to null. */
gfc_conv_descriptor_data_set (&block, lse.expr, null_pointer_node);
gfc_conv_descriptor_data_set (&lse.pre, lse.expr, null_pointer_node);
break;
case EXPR_VARIABLE:
......
2006-10-14 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29371
* gfortran.dg/nullify_3.f90: New test.
2006-10-14 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.dg/pthread-init-2.c (dg-options): Define _POSIX_C_SOURCE=199506L
! { dg-do run }
! { dg-options "-O0 -fbounds-check" }
! Tests patch for PR29371, in which the null pointer
! assignment would cause a segfault with the bounds
! check on.
!
! Contributed by Tobias Burnus <tobias.burnus@physik.fu-berlin.de>
!
program test
implicit none
type projector_t
real, pointer :: ket(:, :), bra(:, :)
end type projector_t
type(projector_t),pointer, dimension(:) :: p
integer :: stat,i
allocate(p(2),stat=stat)
do i = 1, 2
nullify(p(i)%bra)
nullify(p(i)%ket)
end do
do i = 1, 2
if (associated (p(i)%bra)) call abort ()
if (associated (p(i)%ket)) call abort ()
end do
end program
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