From d05360a6128c8ba1e2c616bc94d23a5c686b92db Mon Sep 17 00:00:00 2001 From: Daniel Franke Date: Wed, 1 Aug 2007 08:52:48 -0400 Subject: [PATCH] re PR fortran/32945 (ICE with initialization expressions) gcc/fortran: 2007-08-01 Daniel Franke PR fortran/32945 * expr.c (check_specification_function): Skip check if no symtree is available. gcc/testsuite: 2007-08-01 Daniel Franke PR fortran/32945 * gfortran.dg/initialization_12.f90: New test. From-SVN: r127124 --- gcc/fortran/ChangeLog | 6 ++++ gcc/fortran/expr.c | 4 +++ gcc/testsuite/ChangeLog | 5 ++++ .../gfortran.dg/initialization_12.f90 | 29 +++++++++++++++++++ 4 files changed, 44 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/initialization_12.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 4acddfd1d2c..81ba111c863 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2007-08-01 Daniel Franke + + PR fortran/32945 + * expr.c (check_specification_function): Skip check if no symtree + is available. + 2007-08-01 Paul Thomas PR fortran/31609 diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index 8e608ed615b..10489208073 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -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 */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2ef4a14cd44..81e92962e07 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-08-01 Daniel Franke + + PR fortran/32945 + * gfortran.dg/initialization_12.f90: New test. + 2007-08-01 Paul Thomas 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 index 00000000000..deef2077a55 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/initialization_12.f90 @@ -0,0 +1,29 @@ +! { dg-do compile } +! PR fortran/32945 - ICE in init expressions +! +! Contributed by Florian Ladstaedter +! + +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" } } -- 2.30.2