[Bug fortran/97694] ICE with optional assumed rank class(*) argument
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97694 anlauf at gcc dot gnu.org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED CC||anlauf at gcc dot gnu.org --- Comment #10 from anlauf at gcc dot gnu.org --- Backported Paul's fix to 10-branch after verifying that it does the job. The backport to 9-branch would require more work, thus not done. Closing.
[Bug fortran/97694] ICE with optional assumed rank class(*) argument
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97694 --- Comment #9 from CVS Commits --- The releases/gcc-10 branch has been updated by Harald Anlauf : https://gcc.gnu.org/g:25d45b5dd41a9ab005a5ae8ee8e54be17f2467a2 commit r10-10109-g25d45b5dd41a9ab005a5ae8ee8e54be17f2467a2 Author: Paul Thomas Date: Sun Dec 27 14:59:38 2020 + Fortran: Fix some select rank issues [PR97694 and 97723]. 2020-12-27 Paul Thomas gcc/fortran PR fortran/97694 PR fortran/97723 * check.c (allocatable_check): Select rank temporaries are permitted even though they are treated as associate variables. * resolve.c (gfc_resolve_code): Break on select rank as well as select type so that the block os resolved. * trans-stmt.c (trans_associate_var): Class associate variables that are optional dummies must use the backend_decl. gcc/testsuite/ PR fortran/97694 PR fortran/97723 * gfortran.dg/select_rank_5.f90: New test. (cherry picked from commit c4a678981572c12d158709ace0d3f23dd04cf217)
[Bug fortran/97694] ICE with optional assumed rank class(*) argument
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97694 Tobias Burnus changed: What|Removed |Added CC||burnus at gcc dot gnu.org --- Comment #8 from Tobias Burnus --- Paul – what's the state of this PR? I see a mainline/GCC 11 commit from end of December. Is there more to do?
[Bug fortran/97694] ICE with optional assumed rank class(*) argument
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97694 --- Comment #7 from CVS Commits --- The master branch has been updated by Paul Thomas : https://gcc.gnu.org/g:c4a678981572c12d158709ace0d3f23dd04cf217 commit r11-6346-gc4a678981572c12d158709ace0d3f23dd04cf217 Author: Paul Thomas Date: Sun Dec 27 14:59:38 2020 + Fortran: Fix some select rank issues [PR97694 and 97723]. 2020-12-27 Paul Thomas gcc/fortran PR fortran/97694 PR fortran/97723 * check.c (allocatable_check): Select rank temporaries are permitted even though they are treated as associate variables. * resolve.c (gfc_resolve_code): Break on select rank as well as select type so that the block os resolved. * trans-stmt.c (trans_associate_var): Class associate variables that are optional dummies must use the backend_decl. gcc/testsuite/ PR fortran/97694 PR fortran/97723 * gfortran.dg/select_rank_5.f90: New test.
[Bug fortran/97694] ICE with optional assumed rank class(*) argument
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97694 --- Comment #6 from martin --- There is still a somewhat related problem if a variable of a derived type with allocatable component is provided to cssel. See bug 98342 with a simplified example code (without class(*)).
[Bug fortran/97694] ICE with optional assumed rank class(*) argument
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97694 --- Comment #5 from martin --- Thanks a lot. The patch seems to work great. Tried it with the more complex code from which the two failed tests were boiled down.
[Bug fortran/97694] ICE with optional assumed rank class(*) argument
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97694 Dominique d'Humieres changed: What|Removed |Added Status|NEW |ASSIGNED
[Bug fortran/97694] ICE with optional assumed rank class(*) argument
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97694 Paul Thomas changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |pault at gcc dot gnu.org --- Comment #4 from Paul Thomas --- I guess that it's mine :-) Paul
[Bug fortran/97694] ICE with optional assumed rank class(*) argument
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97694 Paul Thomas changed: What|Removed |Added CC||pault at gcc dot gnu.org --- Comment #3 from Paul Thomas --- Created attachment 49743 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49743&action=edit Fix for this PR and PR97723 This regtests and fixes both PRs Paul select_rank_5.f90: ! { dg-do run } ! ! Test the fixes for PR97723 and PR97694. ! ! Contributed by Martin ! module mod implicit none private public cssel contains function cssel(x) result(s) character(len=:), allocatable :: s class(*), dimension(..), optional, intent(in) :: x if (present(x)) then select rank (x) rank (0) s = '0' ! PR97723: ‘assign’ at (1) is not a function ! PR97694: ICE in trans-stmt.c(trans_associate_var) rank (1) s = '1' ! PR97723: ‘assign’ at (1) is not a function rank default s = '?' ! PR97723: ‘assign’ at (1) is not a function end select else s = '-' end if end function cssel end module mod program classstar_rank use mod implicit none integer :: x real, dimension(1:3) :: y logical, dimension(1:2,1:2) :: z if (any ([cssel(x),cssel(y),cssel(z),cssel()] .ne. ['0','1','?','-'])) stop 1 end program classstar_rank
[Bug fortran/97694] ICE with optional assumed rank class(*) argument
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97694 Martin Liška changed: What|Removed |Added CC||kcy at codesourcery dot com, ||marxin at gcc dot gnu.org Last reconfirmed||2020-11-04 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #2 from Martin Liška --- Started to ICE with r10-3563-g73a28634098cb1ab.
[Bug fortran/97694] ICE with optional assumed rank class(*) argument
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97694 martin changed: What|Removed |Added See Also||https://gcc.gnu.org/bugzill ||a/show_bug.cgi?id=91926 --- Comment #1 from martin --- There are two resolved bug reports which are very similar, bug 61881 and bug 91926. At least bug 91926 is working fine. The other is pretty old and lacks the optional attribute.