re PR fortran/31550 (f951: segfault in fold-const.c:1963)

2007-04-13  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/31550
	* trans-types.c (copy_dt_decls_ifequal): Do not get pointer
	derived type components.

2007-04-13  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/31550
	* gfortran.dg/used_types_16.f90: New test.

From-SVN: r123791
This commit is contained in:
Paul Thomas 2007-04-13 16:01:36 +00:00
parent 0615f92345
commit d6a7a3be74
4 changed files with 63 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2007-04-13 Paul Thomas <pault@gcc.gnu.org>
PR fortran/31550
* trans-types.c (copy_dt_decls_ifequal): Do not get pointer
derived type components.
2007-04-13 Tobias Schlüter <tobi@gcc.gnu.org>
PR fortran/18937

View File

@ -1446,7 +1446,7 @@ copy_dt_decls_ifequal (gfc_symbol *from, gfc_symbol *to)
for (; to_cm; to_cm = to_cm->next, from_cm = from_cm->next)
{
to_cm->backend_decl = from_cm->backend_decl;
if (from_cm->ts.type == BT_DERIVED)
if (!from_cm->pointer && from_cm->ts.type == BT_DERIVED)
gfc_get_derived_type (to_cm->ts.derived);
else if (from_cm->ts.type == BT_CHARACTER)

View File

@ -1,3 +1,8 @@
2007-04-13 Paul Thomas <pault@gcc.gnu.org>
PR fortran/31550
* gfortran.dg/used_types_16.f90: New test.
2007-04-13 Tobias Schlüter <tobi@gcc.gnu.org>
PR fortran/18937

View File

@ -0,0 +1,51 @@
! { dg-do compile }
! Tests the fix for PR31550 in which pointers to derived type components
! were being TREE-SSA declared in the wrong order and so in the incorrect
! context.
!
! Contributed by Daniel Franke <dfranke@gcc.gnu.org>
!
MODULE class_dummy_atom_types
TYPE :: dummy_atom_list
TYPE(dummy_atom), DIMENSION(:), POINTER :: table
INTEGER :: nused
END TYPE
TYPE :: dummy_atom
TYPE(dummy_atom_private), POINTER :: p
END TYPE
TYPE :: dummy_atom_private
TYPE(dummy_atom_list) :: neighbours
END TYPE
END MODULE
MODULE class_dummy_atom_list
USE class_dummy_atom_types, ONLY: dummy_atom_list
INTERFACE
SUBROUTINE dummy_atom_list_init_copy(this, other)
USE class_dummy_atom_types, ONLY: dummy_atom_list
TYPE(dummy_atom_list), INTENT(out) :: this
TYPE(dummy_atom_list), INTENT(in) :: other
END SUBROUTINE
END INTERFACE
INTERFACE
SUBROUTINE dummy_atom_list_merge(this, other)
USE class_dummy_atom_types, ONLY: dummy_atom_list
TYPE(dummy_atom_list), INTENT(inout) :: this
TYPE(dummy_atom_list), INTENT(in) :: other
END SUBROUTINE
END INTERFACE
END MODULE
SUBROUTINE dummy_atom_list_init_copy(this, other)
USE class_dummy_atom_list, ONLY: dummy_atom_list, dummy_atom_list_merge
TYPE(dummy_atom_list), INTENT(out) :: this
TYPE(dummy_atom_list), INTENT(in) :: other
this%table(1:this%nused) = other%table(1:other%nused)
END SUBROUTINE
! { dg-final { cleanup-modules "class_dummy_atom_types class_dummy_atom_list" } }