re PR fortran/58099 ([F03] over-zealous procedure-pointer error checking)

2013-09-20  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/58099
	* expr.c (gfc_check_pointer_assign): Remove second call to
	'gfc_compare_interfaces' with swapped arguments.
	* interface.c (gfc_compare_interfaces): Symmetrize the call to
	'check_result_characteristics' by calling it with swapped arguments.

2013-09-20  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/58099
	* gfortran.dg/proc_ptr_43.f90: New.

From-SVN: r202766
This commit is contained in:
Janus Weil 2013-09-20 09:44:05 +02:00
parent 87fccdbba5
commit 1f46d137d0
5 changed files with 34 additions and 9 deletions

View File

@ -1,3 +1,11 @@
2013-09-20 Janus Weil <janus@gcc.gnu.org>
PR fortran/58099
* expr.c (gfc_check_pointer_assign): Remove second call to
'gfc_compare_interfaces' with swapped arguments.
* interface.c (gfc_compare_interfaces): Symmetrize the call to
'check_result_characteristics' by calling it with swapped arguments.
2013-09-18 Tobias Burnus <burnus@net-b.de>
* expr.c (gfc_check_assign_symbol): Free lvalue.ref.

View File

@ -3581,14 +3581,6 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
return false;
}
if (!gfc_compare_interfaces (s2, s1, name, 0, 1,
err, sizeof(err), NULL, NULL))
{
gfc_error ("Interface mismatch in procedure pointer assignment "
"at %L: %s", &rvalue->where, err);
return false;
}
return true;
}

View File

@ -1416,7 +1416,8 @@ gfc_compare_interfaces (gfc_symbol *s1, gfc_symbol *s2, const char *name2,
if (s1->attr.function && s2->attr.function)
{
/* If both are functions, check result characteristics. */
if (!check_result_characteristics (s1, s2, errmsg, err_len))
if (!check_result_characteristics (s1, s2, errmsg, err_len)
|| !check_result_characteristics (s2, s1, errmsg, err_len))
return 0;
}

View File

@ -1,3 +1,8 @@
2013-09-20 Janus Weil <janus@gcc.gnu.org>
PR fortran/58099
* gfortran.dg/proc_ptr_43.f90: New.
2013-09-18 Tobias Burnus <burnus@net-b.de>
PR fortran/57697

View File

@ -0,0 +1,19 @@
! { dg-do compile }
!
! PR 58099: [4.8/4.9 Regression] [F03] over-zealous procedure-pointer error checking
!
! Contributed by Daniel Price <daniel.price@monash.edu>
implicit none
procedure(real), pointer :: wfunc
wfunc => w_cubic
contains
pure real function w_cubic(q2)
real, intent(in) :: q2
w_cubic = 0.
end function
end