re PR fortran/32945 (ICE with initialization expressions)
authorDaniel Franke <franke.daniel@gmail.com>
Wed, 1 Aug 2007 12:52:48 +0000 (08:52 -0400)
committerDaniel Franke <dfranke@gcc.gnu.org>
Wed, 1 Aug 2007 12:52:48 +0000 (08:52 -0400)
gcc/fortran:
2007-08-01  Daniel Franke  <franke.daniel@gmail.com>

PR fortran/32945
* expr.c (check_specification_function): Skip check if no symtree
is available.

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

PR fortran/32945
* gfortran.dg/initialization_12.f90: New test.

From-SVN: r127124

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

index 4acddfd1d2c7e63ece327da75f86af4a49cada4d..81ba111c86308c0e6a21b45ebdb14344b5f152a6 100644 (file)
@@ -1,3 +1,9 @@
+2007-08-01  Daniel Franke  <franke.daniel@gmail.com>
+
+       PR fortran/32945
+       * expr.c (check_specification_function): Skip check if no symtree 
+       is available.
+
 2007-08-01  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/31609
index 8e608ed615b9a74e0da84474ea8f2b0a4e0c75b5..10489208073123246a4c787349f8b356212dd04d 100644 (file)
@@ -693,6 +693,10 @@ static match
 check_specification_function (gfc_expr *e)
 {
   gfc_symbol *sym;
+
+  if (!e->symtree)
+    return MATCH_NO;
+
   sym = e->symtree->n.sym;
 
   /* F95, 7.1.6.2; F2003, 7.1.7  */
index 2ef4a14cd44ac802318944e4b079fbabb9ff6997..81e92962e07bbc3c3549b964e7c388231b15dcfe 100644 (file)
@@ -1,3 +1,8 @@
+2007-08-01  Daniel Franke  <franke.daniel@gmail.com>
+
+       PR fortran/32945
+       * gfortran.dg/initialization_12.f90: New test.
+
 2007-08-01  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/31609
diff --git a/gcc/testsuite/gfortran.dg/initialization_12.f90 b/gcc/testsuite/gfortran.dg/initialization_12.f90
new file mode 100644 (file)
index 0000000..deef207
--- /dev/null
@@ -0,0 +1,29 @@
+! { dg-do compile }
+! PR fortran/32945 - ICE in init expressions
+!
+! Contributed by Florian Ladstaedter <flad AT gmx DOT at>
+!
+
+MODULE EGOPS_Utilities
+CONTAINS
+  FUNCTION dirname(fullfilename)
+    Character(LEN=*),  Intent(In)    :: fullfilename
+    Character(LEN=LEN(fullfilename)) :: dirname
+    dirname = ''
+  END FUNCTION
+END MODULE EGOPS_Utilities
+
+MODULE AtmoIono
+  CHARACTER(LEN=10), PARAMETER :: ComputeDryAtmModel = 'Dry Atm.  '
+
+  type AtmModel
+    character (len=len(ComputeDryAtmModel)) :: moistDryStr
+  end type AtmModel
+END MODULE AtmoIono
+
+module AtmoIonoSphere
+  use EGOPS_Utilities
+  use AtmoIono
+end module AtmoIonoSphere
+
+! { dg-final { cleanup-modules "EGOPS_Utilities AtmoIono AtmoIonoSphere" } }