re PR fortran/59941 ([OOP] ICE with polymorphic types)

2014-02-03  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/59941
	* expr.c (replace_comp): Check for isym to avoid ICE.

2014-02-03  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/59941
	* gfortran.dg/typebound_proc_26.f90: New.

From-SVN: r207417
This commit is contained in:
Janus Weil 2014-02-03 09:16:06 +01:00
parent 3e2d816f67
commit 05ea6f3ec0
4 changed files with 49 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2014-02-03 Janus Weil <janus@gcc.gnu.org>
PR fortran/59941
* expr.c (replace_comp): Check for isym to avoid ICE.
2014-01-27 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/58007

View File

@ -4195,7 +4195,7 @@ replace_comp (gfc_expr *expr, gfc_symbol *sym, int *i ATTRIBUTE_UNUSED)
gfc_component *comp;
comp = (gfc_component *)sym;
if ((expr->expr_type == EXPR_VARIABLE
|| (expr->expr_type == EXPR_FUNCTION
|| (expr->expr_type == EXPR_FUNCTION && !expr->value.function.isym
&& !gfc_is_intrinsic (expr->symtree->n.sym, 0, expr->where)))
&& expr->symtree->n.sym->ns == comp->ts.interface->formal_ns)
{

View File

@ -1,3 +1,8 @@
2014-02-03 Janus Weil <janus@gcc.gnu.org>
PR fortran/59941
* gfortran.dg/typebound_proc_26.f90: New.
2014-01-29 Markus Trippelsdorf <markus@trippelsdorf.de>
Backport from mainline

View File

@ -0,0 +1,38 @@
! { dg-do compile }
!
! PR 59941: [4.7 Regression] [OOP] ICE with polymorphic types
!
! Contributed by Jürgen Reuter <juergen.reuter@desy.de>
module tao_random_numbers
integer, dimension(10), private :: s_buffer
integer, private :: s_buffer_end = size (s_buffer)
end module
module beam_structures
private
type :: beam_structure_t
integer, dimension(:), allocatable :: smatrix
contains
procedure :: get_smatrix
end type
contains
function get_smatrix (beam_structure) result (matrix)
class(beam_structure_t), intent(in) :: beam_structure
integer, dimension (size (beam_structure%smatrix)) :: matrix
end function
end module
program p
use tao_random_numbers
use beam_structures
end
! { dg-final { cleanup-modules "tao_random_numbers beam_structures" } }