re PR fortran/40594 (wrong-code)

2009-06-30  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/40594
	* trans-types.c (gfc_get_derived_type): Bugfix, reverting one hunk from
	r147206.


2009-06-30  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/40594
	* gfortran.dg/derived_pointer_recursion_2.f90: New.

From-SVN: r149108
This commit is contained in:
Janus Weil 2009-06-30 19:06:27 +02:00
parent 67635176a2
commit 3e6d828d52
4 changed files with 66 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2009-06-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/40594
* trans-types.c (gfc_get_derived_type): Bugfix, reverting one hunk from
r147206.
2009-06-29 Tobias Burnus <burnus@net-b.de>
PR fortran/40580

View File

@ -1946,7 +1946,13 @@ gfc_get_derived_type (gfc_symbol * derived)
/* derived->backend_decl != 0 means we saw it before, but its
components' backend_decl may have not been built. */
if (derived->backend_decl)
return derived->backend_decl;
{
/* Its components' backend_decl have been built. */
if (TYPE_FIELDS (derived->backend_decl))
return derived->backend_decl;
else
typenode = derived->backend_decl;
}
else
{
/* We see this derived type first time, so build the type node. */

View File

@ -1,3 +1,8 @@
2009-06-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/40594
* gfortran.dg/derived_pointer_recursion_2.f90: New.
2009-06-30 Richard Guenther <rguenther@suse.de>
* gcc.dg/tree-ssa/ssa-dce-6.c: New testcase.

View File

@ -0,0 +1,48 @@
! { dg-do run }
!
! PR 40594: [4.5 Regression] wrong-code
!
! Original test case by Daniel Franke <dfranke@gcc.gnu.org>
! Modified by Janus Weil <janus@gcc.gnu.org>
MODULE atom_types
TYPE :: atom_list
TYPE(atom_private), DIMENSION(:), pointer :: table
END TYPE
TYPE :: atom_private
TYPE(atom_list) :: neighbours
LOGICAL :: initialized = .true.
END TYPE
TYPE :: atom_model
TYPE(atom_list) :: atoms
integer :: dummy
END TYPE
contains
SUBROUTINE init(this)
TYPE(atom_private) :: this
this%initialized = .FALSE.
END SUBROUTINE
END MODULE
program pr40594
USE atom_types
TYPE(atom_model) :: am
type(atom_private) :: ap
am%dummy = 0
call init(ap)
if (ap%initialized .neqv. .false.) call abort()
END
! { dg-final { cleanup-modules "atom_types" } }