re PR fortran/30238 (associated(null-pointer, null-pointer) returns .true.)

fortran/
2007-01-02  Tobias Burnus  <burnus@net-b.de>

       PR fortran/30238
       * trans-intrinsic.c: Check for associated(NULL,NULL).

libgfortran/
2007-01-02  Tobias Burnus  <burnus@net-b.de>

       * intrinsics/associated.c: Check for associated(NULL,NULL).

testsuite/
2007-01-02  Tobias Burnus  <burnus@net-b.de>

       PR fortran/30238
       * gfortran.dg/associated_1.f90: Add test for associated(NULL,NULL).
       * gfortran.dg/associated_2.f90: Add test for associated(NULL,NULL).

From-SVN: r120338
This commit is contained in:
Tobias Burnus
2007-01-02 13:48:14 +01:00
committed by Tobias Burnus
parent 4e13f3fe18
commit cf7b154f7d
7 changed files with 25 additions and 1 deletions

View File

@@ -1,3 +1,8 @@
2007-01-02 Tobias Burnus <burnus@net-b.de>
PR fortran/30238
* trans-intrinsic.c: Check for associated(NULL,NULL).
2006-12-31 Paul Thomas <pault@gcc.gnu.org>
PR fortran/30202

View File

@@ -3075,7 +3075,9 @@ gfc_conv_associated (gfc_se *se, gfc_expr *expr)
gfc_add_block_to_block (&se->pre, &arg1se.pre);
gfc_add_block_to_block (&se->post, &arg1se.post);
tmp = build2 (EQ_EXPR, boolean_type_node, arg1se.expr, arg2se.expr);
se->expr = tmp;
tmp2 = build2 (NE_EXPR, boolean_type_node, arg1se.expr,
null_pointer_node);
se->expr = build2 (TRUTH_AND_EXPR, boolean_type_node, tmp, tmp2);
}
else
{

View File

@@ -1,3 +1,9 @@
2007-01-02 Tobias Burnus <burnus@net-b.de>
PR fortran/30238
* gfortran.dg/associated_1.f90: Add test for associated(NULL,NULL).
* gfortran.dg/associated_2.f90: Add test for associated(NULL,NULL).
2007-01-01 Andreas Schwab <schwab@suse.de>
PR target/29166

View File

@@ -4,7 +4,10 @@
program test
real, pointer :: a, b
nullify(a,b)
if(associated(a,b).or.associated(a,a)) call abort()
allocate(a)
if(associated(b,a)) call abort()
if (.not.associated(x(a))) call abort ()
if (.not.associated(a, x(a))) call abort ()

View File

@@ -17,6 +17,8 @@ contains
! the target argument is not present (case (i))
if (.not. associated (b)) call abort ()
deallocate (a)
nullify(a)
if(associated(a,a)) call abort()
allocate (a(2,1,2))
b => a
if (.not.associated (b)) call abort ()

View File

@@ -1,3 +1,7 @@
2007-01-02 Tobias Burnus <burnus@net-b.de>
* intrinsics/associated.c: Check for associated(NULL,NULL).
2006-12-18 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/30145

View File

@@ -39,6 +39,8 @@ associated (const gfc_array_void *pointer, const gfc_array_void *target)
{
int n, rank;
if (GFC_DESCRIPTOR_DATA (pointer) == NULL)
return 0;
if (GFC_DESCRIPTOR_DATA (pointer) != GFC_DESCRIPTOR_DATA (target))
return 0;
if (GFC_DESCRIPTOR_DTYPE (pointer) != GFC_DESCRIPTOR_DTYPE (target))