OSDN Git Service

gcc/fortran:
authordfranke <dfranke@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 Jan 2008 21:28:20 +0000 (21:28 +0000)
committerdfranke <dfranke@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 Jan 2008 21:28:20 +0000 (21:28 +0000)
2008-01-24  Daniel Franke  <franke.daniel@gmail.com>

        PR fortran/34202
* data.c (formalize_structure_cons): Skip formalization on
empty structures.

gcc/testsuite:
2008-01-24  Daniel Franke  <franke.daniel@gmail.com>

        PR fortran/34202
        * gfortran.dg/empty_type.f90: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131810 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/data.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/empty_type.f90 [new file with mode: 0644]

index 2998e73..c9cdfde 100644 (file)
@@ -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.
index 59ac5e9..41dc85f 100644 (file)
@@ -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;
index 70f1e0d..8af0ba2 100644 (file)
@@ -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 (file)
index 0000000..cea2566
--- /dev/null
@@ -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
+