[Bug fortran/77385] "Unclassifiable statement" from gfortran
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77385 --- Comment #8 from Paul Thomas --- Author: pault Date: Sun Jan 27 18:53:47 2019 New Revision: 268317 URL: https://gcc.gnu.org/viewcvs?rev=268317=gcc=rev Log: 2019-01-27 Paul Thomas Backport from trunk PR fortran/56386 PR fortran/58906 PR fortran/77385 PR fortran/80260 PR fortran/82077 * resolve.c (resolve_variable): Fix up expressions with array associate names, where the parser did not detect that this is array and there was no array part_ref in the expression. * trans-expr.c (gfc_find_and_cut_at_last_class_ref): base_expr should be a copy of e and not the initialization expr. 2019-01-27 Paul Thomas Backport from trunk PR fortran/56386 PR fortran/58906 PR fortran/77385 * gfortran.dg/associate_44.f90 : New test. PR fortran/80260 * gfortran.dg/select_type_45.f90 : New test. PR fortran/82077 * gfortran.dg/select_type_46.f90 : New test. Added: branches/gcc-7-branch/gcc/testsuite/gfortran.dg/associate_44.f90 branches/gcc-7-branch/gcc/testsuite/gfortran.dg/select_type_45.f90 branches/gcc-7-branch/gcc/testsuite/gfortran.dg/select_type_46.f90 Modified: branches/gcc-7-branch/gcc/fortran/ChangeLog branches/gcc-7-branch/gcc/fortran/resolve.c branches/gcc-7-branch/gcc/fortran/trans-expr.c branches/gcc-7-branch/gcc/testsuite/ChangeLog
[Bug fortran/77385] "Unclassifiable statement" from gfortran
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77385 --- Comment #7 from Paul Thomas --- Author: pault Date: Sun Jan 27 18:02:17 2019 New Revision: 268313 URL: https://gcc.gnu.org/viewcvs?rev=268313=gcc=rev Log: 2019-01-27 Paul Thomas Backport from trunk PR fortran/56386 PR fortran/58906 PR fortran/77385 PR fortran/80260 PR fortran/82077 * resolve.c (resolve_variable): Fix up expressions with array associate names, where the parser did not detect that this is array and there was no array part_ref in the expression. * trans-expr.c (gfc_find_and_cut_at_last_class_ref): base_expr should be a copy of e and not the initialization expr. 2019-01-27 Paul Thomas Backport from trunk PR fortran/56386 PR fortran/58906 PR fortran/77385 * gfortran.dg/associate_44.f90 : New test. PR fortran/80260 * gfortran.dg/select_type_45.f90 : New test. PR fortran/82077 * gfortran.dg/select_type_46.f90 : New test. Added: branches/gcc-8-branch/gcc/testsuite/gfortran.dg/associate_44.f90 branches/gcc-8-branch/gcc/testsuite/gfortran.dg/select_type_45.f90 branches/gcc-8-branch/gcc/testsuite/gfortran.dg/select_type_46.f90 Modified: branches/gcc-8-branch/gcc/fortran/ChangeLog branches/gcc-8-branch/gcc/fortran/resolve.c branches/gcc-8-branch/gcc/fortran/trans-expr.c branches/gcc-8-branch/gcc/testsuite/ChangeLog
[Bug fortran/77385] "Unclassifiable statement" from gfortran
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77385 Dominique d'Humieres changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #6 from Dominique d'Humieres --- AFAICT everything has been fixed, closing.
[Bug fortran/77385] "Unclassifiable statement" from gfortran
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77385 Martin Liška changed: What|Removed |Added CC||marxin at gcc dot gnu.org --- Comment #5 from Martin Liška --- Paul: Can you please update Known to work?
[Bug fortran/77385] "Unclassifiable statement" from gfortran
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77385 --- Comment #4 from Paul Thomas --- Author: pault Date: Wed Oct 17 07:16:16 2018 New Revision: 265232 URL: https://gcc.gnu.org/viewcvs?rev=265232=gcc=rev Log: 2018-10-17 Paul Thomas PR fortran/56386 PR fortran/58906 PR fortran/77385 PR fortran/80260 PR fortran/82077 * resolve.c (resolve_variable): Fix up expressions with array associate names, where the parser did not detect that this is array and there was no array part_ref in the expression. 2018-10-17 Paul Thomas PR fortran/56386 PR fortran/58906 PR fortran/77385 * gfortran.dg/associate_44.f90 : New test. PR fortran/80260 * gfortran.dg/select_type_45.f90 : New test. PR fortran/82077 * gfortran.dg/select_type_46.f90 : New test. Added: trunk/gcc/testsuite/gfortran.dg/associate_44.f90 trunk/gcc/testsuite/gfortran.dg/select_type_45.f90 trunk/gcc/testsuite/gfortran.dg/select_type_46.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/resolve.c trunk/gcc/testsuite/ChangeLog
[Bug fortran/77385] "Unclassifiable statement" from gfortran
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77385 --- Comment #3 from Paul Thomas --- (In reply to Dominique d'Humieres from comment #1) > Confirmed from 4.7 up to trunk (7.0), Polymorphic arrays are not yet > supported on 4.6. > > Note that the following variant > > MODULE a >IMPLICIT NONE >TYPE :: b > CONTAINS > PROCEDURE :: e >END TYPE b >TYPE :: c > CLASS(b), POINTER :: i(:) => NULL() >END TYPE c >CONTAINS > FUNCTION e(this ) RESULT (s) > CLASS(b) :: this > TYPE(b) :: s > s = b() > END FUNCTION e > END MODULE a > MODULE m >USE a >IMPLICIT NONE >TYPE d > CLASS(b), DIMENSION(:), POINTER :: f => NULL() >END TYPE d >CONTAINS > FUNCTION g() RESULT (h) > TYPE(d) :: j > TYPE(c) :: h > allocate(j%f(1)) > print *, shape(j%f) > ASSOCIATE( k => j%f ) > END ASSOCIATE > END FUNCTION g > END MODULE m >use m >type(c) :: res >res = g() > end > > gives > > ASSOCIATE( k => j%f ) > > internal compiler error: Segmentation fault: 11 > > and > > MODULE a >IMPLICIT NONE >TYPE :: b > CONTAINS > PROCEDURE :: e >END TYPE b >TYPE :: c > CLASS(b), POINTER :: i(:) => NULL() >END TYPE c >CONTAINS > FUNCTION e(this ) RESULT (s) > CLASS(b) :: this > TYPE(b) :: s > s = b() > END FUNCTION e > END MODULE a > MODULE m >USE a >IMPLICIT NONE >TYPE d > CLASS(b), DIMENSION(:), POINTER :: f => NULL() >END TYPE d >CONTAINS > FUNCTION g() RESULT (h) > TYPE(d) :: j > TYPE(c) :: h > ALLOCATE(h%i(1)) > allocate(j%f(1)) > SELECT TYPE ( l => h%i ) > TYPE IS ( b ) >l(1) = j*f(1)%e() > END SELECT > END FUNCTION g > END MODULE m > > gives > > l(1) = j*f(1)%e() > 1 > Error: Symbol 'f' at (1) has no IMPLICIT type I am not surprised at the error in the second variant. Replace the offending statement by l(1) = j%f(1)%e() and all is well. Paul
[Bug fortran/77385] "Unclassifiable statement" from gfortran
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77385 Paul Thomas changed: What|Removed |Added CC||pault at gcc dot gnu.org Assignee|unassigned at gcc dot gnu.org |pault at gcc dot gnu.org --- Comment #2 from Paul Thomas --- According to Dominique's message to the list this morning, I have fixed the variant in comment#1 and so I had better take it. Paul
[Bug fortran/77385] "Unclassifiable statement" from gfortran
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77385 Dominique d'Humieres changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2016-09-28 Ever confirmed|0 |1 --- Comment #1 from Dominique d'Humieres --- Confirmed from 4.7 up to trunk (7.0), Polymorphic arrays are not yet supported on 4.6. Note that the following variant MODULE a IMPLICIT NONE TYPE :: b CONTAINS PROCEDURE :: e END TYPE b TYPE :: c CLASS(b), POINTER :: i(:) => NULL() END TYPE c CONTAINS FUNCTION e(this ) RESULT (s) CLASS(b) :: this TYPE(b) :: s s = b() END FUNCTION e END MODULE a MODULE m USE a IMPLICIT NONE TYPE d CLASS(b), DIMENSION(:), POINTER :: f => NULL() END TYPE d CONTAINS FUNCTION g() RESULT (h) TYPE(d) :: j TYPE(c) :: h allocate(j%f(1)) print *, shape(j%f) ASSOCIATE( k => j%f ) END ASSOCIATE END FUNCTION g END MODULE m use m type(c) :: res res = g() end gives ASSOCIATE( k => j%f ) internal compiler error: Segmentation fault: 11 and MODULE a IMPLICIT NONE TYPE :: b CONTAINS PROCEDURE :: e END TYPE b TYPE :: c CLASS(b), POINTER :: i(:) => NULL() END TYPE c CONTAINS FUNCTION e(this ) RESULT (s) CLASS(b) :: this TYPE(b) :: s s = b() END FUNCTION e END MODULE a MODULE m USE a IMPLICIT NONE TYPE d CLASS(b), DIMENSION(:), POINTER :: f => NULL() END TYPE d CONTAINS FUNCTION g() RESULT (h) TYPE(d) :: j TYPE(c) :: h ALLOCATE(h%i(1)) allocate(j%f(1)) SELECT TYPE ( l => h%i ) TYPE IS ( b ) l(1) = j*f(1)%e() END SELECT END FUNCTION g END MODULE m gives l(1) = j*f(1)%e() 1 Error: Symbol 'f' at (1) has no IMPLICIT type