re PR fortran/50570 (Incorrect error for assignment to intent(in) pointer)

2011-10-14  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/50570
	* expr.c (gfc_check_vardef_context): Don't throw an error on
	non-pointer assignments involving an intent(in) pointer dummy.


2011-10-14  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/50570
	* gfortran.dg/pointer_intent_5.f90: New.

From-SVN: r180000
This commit is contained in:
Janus Weil 2011-10-14 19:59:29 +02:00
parent e14ca379ad
commit 6fd7dd5719
4 changed files with 36 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2011-10-14 Janus Weil <janus@gcc.gnu.org>
PR fortran/50570
* expr.c (gfc_check_vardef_context): Don't throw an error on
non-pointer assignments involving an intent(in) pointer dummy.
2011-10-14 Tobias Burnus <burnus@net-b.de>
PR fortran/50718

View File

@ -4635,7 +4635,7 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj,
sym->name, context, &e->where);
return FAILURE;
}
if (!pointer && !is_pointer)
if (!pointer && !is_pointer && !sym->attr.pointer)
{
if (context)
gfc_error ("Dummy argument '%s' with INTENT(IN) in variable"

View File

@ -1,3 +1,8 @@
2011-10-14 Janus Weil <janus@gcc.gnu.org>
PR fortran/50570
* gfortran.dg/pointer_intent_5.f90: New.
2011-10-14 Artjoms Sinkarovs <artyom.shinkaroff@gmail.com>
* gcc.target/i386/warn-vect-op-3.c: Exclude 32-bit architectures.

View File

@ -0,0 +1,24 @@
! { dg-do run }
!
! PR 50570: [4.6/4.7 Regression] Incorrect error for assignment to intent(in) pointer
!
! Contributed by Bill Long <longb@cray.com>
program bots_sparselu_pointer_intent_in
implicit none
integer, pointer :: array(:)
allocate(array(4))
array = 0
call sub(array)
if (sum(array)/=1) call abort
contains
subroutine sub(dummy)
integer, pointer, intent(in) :: dummy(:)
dummy(1) = 1
end subroutine sub
end program