From c39373da4911f9246dec9b50011ed2aa9247c2c1 Mon Sep 17 00:00:00 2001 From: Paul Brook Date: Thu, 13 May 2004 23:22:13 +0000 Subject: [PATCH] re PR fortran/15314 (ICE caused by array initializer in derived type definition) PR fortran/15314 * gfortran.fortran-torture/execute/der_init_s.f90: New test. From-SVN: r81818 --- gcc/fortran/ChangeLog | 2 +- gcc/testsuite/ChangeLog | 5 +++++ .../gfortran.fortran-torture/execute/der_init_2.f90 | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gfortran.fortran-torture/execute/der_init_2.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index e32d188..8939fc4 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,4 +1,4 @@ -2004-05-13 Paul Brook +2004-05-13 Victor Leikehman PR fortran/15314 * trans-expr.c (gfc_conv_structure): Use field type, not expr type. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 65705ec..4ac96da 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-05-13 Paul Brook + + PR fortran/15314 + * gfortran.fortran-torture/execute/der_init_s.f90: New test. + 2004-05-13 Andrew Pinski * gcc.dg/uninit-H.c: Test for __PPC__ and __ppc__ diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/der_init_2.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/der_init_2.f90 new file mode 100644 index 0000000..d0448a5 --- /dev/null +++ b/gcc/testsuite/gfortran.fortran-torture/execute/der_init_2.f90 @@ -0,0 +1,15 @@ +! PR 15314 +! We were looking at the type of the initialization expression, not the type +! of the field. +program der_init_2 + implicit none + type foo + integer :: a(3) = 42 + integer :: b = 123 + end type + + type (foo) :: v + + if ((v%b .ne. 123) .or. any (v%a .ne. 42)) call abort (); +end program + -- 2.7.4