[Bug fortran/69498] ICE on disjunct cases with displaced or incomplete embedded statement
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69498 --- Comment #1 from Gerhard Steinmetz --- $ cat z3.f90 program p if (2 > 1) then submodule (m) sm end if end $ gfortran-6 -c z3.f90 f951: internal compiler error: gfc_get_default_type(): Bad symbol ...
[Bug fortran/69498] ICE on disjunct cases with displaced or incomplete embedded statement
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69498 --- Comment #2 from Gerhard Steinmetz --- And one more exotic, sorry ... $ cat z7.f90 program p submodule (m) sm submodule (m) sm $ gfortran-6 -c z7.f90 f951: internal compiler error: in gfc_match_submodule, at fortran/module.c:748
[Bug fortran/69498] ICE on disjunct cases with displaced or incomplete embedded statement
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69498 Dominique d'Humieres changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2016-01-27 Ever confirmed|0 |1 --- Comment #3 from Dominique d'Humieres --- Confirmed from 4.8 up to trunk (6.0) for the first test in comment 0. Submodules are not supported before gcc 6.0 and the other tests give errors without ICE before 6.0.
[Bug fortran/69498] ICE on disjunct cases with displaced or incomplete embedded statement
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69498 --- Comment #4 from koenigni at gcc dot gnu.org --- Author: koenigni Date: Tue Mar 21 14:49:21 2017 New Revision: 246322 URL: https://gcc.gnu.org/viewcvs?rev=246322&root=gcc&view=rev Log: 2017-03-18 Nicolas Koenig PR fortran/69498 * decl.c (add_hidden_procptr_result): Fixed Refs count of the created "ppr@" symbol. 2017-03-18 Nicolas Koenig PR fortran/69498 * gfortran.dg/unexp_attribute.f90: New test Added: trunk/gcc/testsuite/gfortran.dg/unexp_attribute.f90 Modified: trunk/gcc/fortran/decl.c
[Bug fortran/69498] ICE on disjunct cases with displaced or incomplete embedded statement
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69498 koenigni at gcc dot gnu.org changed: What|Removed |Added Status|NEW |ASSIGNED CC||koenigni at gcc dot gnu.org, ||pault at gcc dot gnu.org Assignee|unassigned at gcc dot gnu.org |koenigni at gcc dot gnu.org --- Comment #5 from koenigni at gcc dot gnu.org --- Proposed fix for z2.f90 and z3.f90. Index: symbol.c === --- symbol.c(Revision 246320) +++ symbol.c(Arbeitskopie) @@ -2782,10 +2782,20 @@ void gfc_delete_symtree (gfc_symtree **root, const char *name) { gfc_symtree st, *st0; + const char *p; - st0 = gfc_find_symtree (*root, name); + /* Submodules are marked as mod.submod. When freeing a submodule + symbol, the symtree only has "submod", so adjust that here. */ - st.name = gfc_get_string ("%s", name); + p = strchr(name, '.'); + if (p) +p++; + else +p = name; + + st0 = gfc_find_symtree (*root, p); + + st.name = gfc_get_string ("%s", p); gfc_delete_bbt (root, &st, compare_symtree); free (st0);
[Bug fortran/69498] ICE on disjunct cases with displaced or incomplete embedded statement
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69498 --- Comment #6 from koenigni at gcc dot gnu.org --- > + p = strchr(name, '.'); s/strchr/strrchr Also, regression tested for x86_64-pc-linux-gnu
[Bug fortran/69498] ICE on disjunct cases with displaced or incomplete embedded statement
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69498 --- Comment #7 from koenigni at gcc dot gnu.org --- Author: koenigni Date: Tue Apr 4 13:41:41 2017 New Revision: 246679 URL: https://gcc.gnu.org/viewcvs?rev=246679&root=gcc&view=rev Log: 2017-03-18 Nicolas Koenig PR fortran/69498 * symbol.c (gfc_delete_symtree): If there is a period in the name, ignore everything before it. 2017-03-18 Nicolas Koenig PR fortran/69498 * gfortran.dg/submodule_unexp.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/submodule_unexp.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/symbol.c trunk/gcc/testsuite/ChangeLog
[Bug fortran/69498] ICE on disjunct cases with displaced or incomplete embedded statement
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69498 koenigni at gcc dot gnu.org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED --- Comment #8 from koenigni at gcc dot gnu.org --- Fixed on trunk, closing.
[Bug fortran/69498] ICE on disjunct cases with displaced or incomplete embedded statement
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69498 Dominique d'Humieres changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|FIXED |--- --- Comment #9 from Dominique d'Humieres --- The test in comment 2 (z7.f90) still gives an ICE at revision r246695 pr69498_3.f90:2:16: submodule (m) sm 1 Error: Unexpected SUBMODULE statement at (1) f951: internal compiler error: in gfc_match_submodule, at fortran/module.c:745
[Bug fortran/69498] ICE on disjunct cases with displaced or incomplete embedded statement
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69498 --- Comment #10 from Nicolas Koenig --- Author: koenigni Date: Mon Apr 10 20:58:21 2017 New Revision: 246826 URL: https://gcc.gnu.org/viewcvs?rev=246826&root=gcc&view=rev Log: 2017-04-10 Nicolas Koenig Paul Thomas PR fortran/69498 * module.c (gfc_match_submodule): Add error if function is called in the wrong state. 2017-04-10 Nicolas Koenig PR fortran/69498 * gfortran.dg/submodule_unexp.f90: Modified test to account for new error. * gfortran.dg/submodule_twice.f90: New Test Added: trunk/gcc/testsuite/gfortran.dg/submodule_twice.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/module.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gfortran.dg/submodule_unexp.f90
[Bug fortran/69498] ICE on disjunct cases with displaced or incomplete embedded statement
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69498 Nicolas Koenig changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution|--- |FIXED --- Comment #11 from Nicolas Koenig --- Fixed on trunk (this time for real), closing (again).