This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[patch, fortran] PR32945 - ICE in initialization expression
- From: Daniel Franke <franke dot daniel at gmail dot com>
- To: fortran at gcc dot gnu dot org
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 1 Aug 2007 13:02:57 +0200
- Subject: [patch, fortran] PR32945 - ICE in initialization expression
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:from:to:subject:date:user-agent:cc:mime-version:content-type:message-id; b=I7CYCLecgfr9UD+ca35BRAlJ6zUJouONKZuvTXaDHv2NQi9F0TpVd9BydHodrVPPXXKGx8Si/sMJWSY7zdFQxpl+eH1iKa5C6lFLIZRMMhPWVqHOyK/KMA47/w3hYzJ+QMb0wbep2fcV7uPud4wL+pVQdJAmoMo69CPIn5sgqWA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:from:to:subject:date:user-agent:cc:mime-version:content-type:message-id; b=R+vDGCLWiXkaqzIEafCFKIAVl40Qxy4wjF7x++Fhb9GwE7zfbSNrfLUhIdC00q2k+EVCYx9+6Rql5uNhKh/NXCH8noFEQttwZExzvKJa9gV5veSkh8Wm5jF4Ph9+Hl44A85QthQHVfUTTncHvD/wU2vqnULRccTb/QPDkSlRJas=
Attached patch fixes the ICE initially reported by Florian Ladtstaedter:
http://gcc.gnu.org/ml/fortran/2007-07/msg00587.html
:ADDPATCH fortran:
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.
Bootstrapped and regression tested on i686-pc-linux-gnu. Ok for trunk?
Regards
Daniel
Index: fortran/expr.c
===================================================================
--- fortran/expr.c (revision 127062)
+++ fortran/expr.c (working copy)
@@ -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: testsuite/gfortran.dg/initialization_12.f90
===================================================================
--- testsuite/gfortran.dg/initialization_12.f90 (revision 0)
+++ testsuite/gfortran.dg/initialization_12.f90 (revision 0)
@@ -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" } }