Commit 20167823 by Andre Vehreschild Committed by Dominique d'Humieres

re PR fortran/60414 (internal compiler error: tree check)

2014-12-05  Andre Vehreschild  <vehre@gmx.de>

	PR fortran/60414
	* interface.c (compare_parameter): Remove class argument rank
	check short circuit.

2014-12-05  Andre Vehreschild  <vehre@gmx.de>

	PR fortran/60414
	* gfortran.dg/unlimited_polymorphism_18.f90: New test.

From-SVN: r218422
parent 6a4bad95
2014-12-05 Andre Vehreschild <vehre@gmx.de>
PR fortran/60414
* interface.c (compare_parameter): Remove class argument rank
check short circuit.
2014-12-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
* error.c (gfc_diagnostic_build_locus_prefix): Use
......
......@@ -2157,10 +2157,6 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual,
if (symbol_rank (formal) == actual->rank || symbol_rank (formal) == -1)
return 1;
if (actual->ts.type == BT_CLASS && CLASS_DATA (actual)->as
&& CLASS_DATA (actual)->as->rank == symbol_rank (formal))
return 1;
rank_check = where != NULL && !is_elemental && formal->as
&& (formal->as->type == AS_ASSUMED_SHAPE
|| formal->as->type == AS_DEFERRED)
......
2014-12-05 Andre Vehreschild <vehre@gmx.de>
PR fortran/60414
* gfortran.dg/unlimited_polymorphism_18.f90: New test.
2014-12-05 Ilya Enkovich <ilya.enkovich@intel.com>
PR target/64056
......
! { dg-do run }
! Testing fix for
! PR fortran/60414
!
module m
implicit none
Type T
real, public :: expectedScalar;
contains
procedure :: FCheck
procedure :: FCheckArr
generic :: Check => FCheck, FCheckArr
end Type
contains
subroutine FCheck(this,X)
class(T) this
class(*) X
real :: r
select type (X)
type is (real)
if ( abs (X - this%expectedScalar) > 0.0001 ) then
call abort()
end if
class default
call abort ()
end select
end subroutine FCheck
subroutine FCheckArr(this,X)
class(T) this
class(*) X(:)
integer i
do i = 1,6
this%expectedScalar = i - 1.0
call this%FCheck(X(i))
end do
end subroutine FCheckArr
subroutine CheckTextVector(vec, n, scal)
integer, intent(in) :: n
class(*), intent(in) :: vec(n)
class(*), intent(in) :: scal
integer j
Type(T) :: Tester
! Check full vector
call Tester%Check(vec)
! Check a scalar of the same class like the vector
Tester%expectedScalar = 5.0
call Tester%Check(scal)
! Check an element of the vector, which is a scalar
j=3
Tester%expectedScalar = 2.0
call Tester%Check(vec(j))
end subroutine CheckTextVector
end module
program test
use :: m
implicit none
real :: vec(1:6) = (/ 0, 1, 2, 3, 4, 5 /)
call checktextvector(vec, 6, 5.0)
end program test
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