From dec9e22db11897ee4bda060bd9169d612144d37e Mon Sep 17 00:00:00 2001 From: Daniel Franke Date: Sat, 14 Jul 2007 09:33:51 -0400 Subject: re PR fortran/32724 (ICE on statement function in specification part of module) gcc/fortran: 2007-07-14 Paul Thomas PR fortran/32724 * parse.c (parse_spec): Emit error on unexpected statement function. gcc/testsuite: 2007-07-14 Daniel Franke PR fortran/32724 * gfortran.dg/stfunc_5.f90: New test. From-SVN: r126638 --- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/parse.c | 7 +++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/stfunc_5.f90 | 11 +++++++++++ 4 files changed, 29 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/stfunc_5.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 9b0a0a4..3c72673 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2007-07-14 Paul Thomas + + PR fortran/32724 + * parse.c (parse_spec): Emit error on unexpected statement + function. + 2007-07-13 Daniel Franke * invoke.texi: Unified upper- and lower-case in menus. diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index f1f9028..df31bcd 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -1902,6 +1902,13 @@ loop: break; + case ST_STATEMENT_FUNCTION: + if (gfc_current_state () == COMP_MODULE) + { + unexpected_statement (st); + break; + } + default: break; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f84bffc..e858484 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-07-14 Daniel Franke + + PR fortran/32724 + * gfortran.dg/stfunc_5.f90: New test. + 2007-07-14 Uros Bizjak * lib/target-supports.exp (check_effective_target_vect_aligned_arrays): diff --git a/gcc/testsuite/gfortran.dg/stfunc_5.f90 b/gcc/testsuite/gfortran.dg/stfunc_5.f90 new file mode 100644 index 0000000..09b6da3 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/stfunc_5.f90 @@ -0,0 +1,11 @@ +! { dg-do compile } +! +! PR fortran/32724 +! ICE on statement function in specification part of module + +MODULE stmt +f(x) = x**2 ! { dg-error "Unexpected STATEMENT FUNCTION" } +END MODULE + +! { dg-final { cleanup-modules "stmt" } } + -- cgit v1.1