diff options
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/data.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/empty_type.f90 | 19 |
4 files changed, 33 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 2998e73f894..c9cdfde362e 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,11 @@ 2008-01-24 Daniel Franke <franke.daniel@gmail.com> + PR fortran/34202 + * data.c (formalize_structure_cons): Skip formalization on + empty structures. + +2008-01-24 Daniel Franke <franke.daniel@gmail.com> + * gfortran.texi (OpenMP): Extended existing documentation. (contributors): Added major contributors of 2008 that were not listed yet. diff --git a/gcc/fortran/data.c b/gcc/fortran/data.c index 59ac5e9d8e6..41dc85f8fa0 100644 --- a/gcc/fortran/data.c +++ b/gcc/fortran/data.c @@ -688,7 +688,7 @@ formalize_structure_cons (gfc_expr *expr) c = expr->value.constructor; /* Constructor is already formalized. */ - if (c->n.component == NULL) + if (!c || c->n.component == NULL) return; head = tail = NULL; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 70f1e0d5c1d..8af0ba245b4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,7 +1,12 @@ +2008-01-24 Daniel Franke <franke.daniel@gmail.com> + + PR fortran/34202 + * gfortran.dg/empty_type.f90: New test. + 2008-01-24 Paolo Carlini <pcarlini@suse.de> - PR c++/34603 - * g++.dg/template/crash77.C: New. + PR c++/34603 + * g++.dg/template/crash77.C: New. 2008-01-24 Uros Bizjak <ubizjak@gmail.com> diff --git a/gcc/testsuite/gfortran.dg/empty_type.f90 b/gcc/testsuite/gfortran.dg/empty_type.f90 new file mode 100644 index 00000000000..cea25660dce --- /dev/null +++ b/gcc/testsuite/gfortran.dg/empty_type.f90 @@ -0,0 +1,19 @@ +! { dg-do compile } +! PR fortran/34202 +! ICE on contruction of empty types +! Testcase contributed by Tobias Burnus + +program bug4a + implicit none + type bug4 + ! Intentionally left empty + end type bug4 + + type compound + type(bug4) b + end type compound + + type(bug4), parameter :: f = bug4() + type(compound), parameter :: g = compound(bug4()) +end program bug4a + |