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

fortran/
2006-12-19  Tobias Burnus  <burnus@net-b.de>

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

testsuite/
2006-12-19  Tobias Burnus  <burnus@net-b.de>

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

From-SVN: r120056
This commit is contained in:
Tobias Burnus 2006-12-19 20:41:35 +01:00
parent 41da2805f3
commit 23572654a2
4 changed files with 18 additions and 3 deletions

View File

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

View File

@ -3142,7 +3142,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->pre, &arg1se.pre);
gfc_add_block_to_block (&se->post, &arg1se.post); gfc_add_block_to_block (&se->post, &arg1se.post);
tmp = build2 (EQ_EXPR, boolean_type_node, arg1se.expr, arg2se.expr); 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 else
{ {

View File

@ -1,3 +1,8 @@
2006-12-19 Tobias Burnus <burnus@net-b.de>
PR fortran/39238
* gfortran.dg/associated_1.f90: Add test for associated(NULL,NULL).
2006-12-19 Paul Thomas <pault@gcc.gnu.org> 2006-12-19 Paul Thomas <pault@gcc.gnu.org>
PR fortran/30236 PR fortran/30236
@ -41,8 +46,8 @@
2006-12-18 Bill Wendling <wendling@apple.com> 2006-12-18 Bill Wendling <wendling@apple.com>
* g++.old-deja/g++.mike/p11144.C: Renamed id to ID because * g++.old-deja/g++.mike/p11144.C: Renamed id to ID because
id is an OjbC keyword. id is an OjbC keyword.
2006-12-18 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2006-12-18 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>

View File

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