public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug fortran/107900] New: Select type with intrinsic type inside associate causes ICE / Segmenation fault @ 2022-11-28 20:43 kaiserkarl31 at yahoo dot com 2022-11-28 20:54 ` [Bug fortran/107900] " anlauf at gcc dot gnu.org ` (3 more replies) 0 siblings, 4 replies; 5+ messages in thread From: kaiserkarl31 at yahoo dot com @ 2022-11-28 20:43 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107900 Bug ID: 107900 Summary: Select type with intrinsic type inside associate causes ICE / Segmenation fault Product: gcc Version: 12.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: kaiserkarl31 at yahoo dot com Target Milestone: --- Using a polymorphic derived type element in a select type statement is not allowed, but placing it in an associate block causes an internal compiler error if one of the "type is" statements includes an intrinsic type. The following program is enough to reproduce it in GFortran 12.2.1: program test class(*), pointer :: ptr associate (c => ptr) select type (c) type is (integer) print *, 'integer' end select end associate end program test Note that the above program wouldn't run, as "ptr" isn't associated with anything, but it shouldn't generate an ICE either. ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/107900] Select type with intrinsic type inside associate causes ICE / Segmenation fault 2022-11-28 20:43 [Bug fortran/107900] New: Select type with intrinsic type inside associate causes ICE / Segmenation fault kaiserkarl31 at yahoo dot com @ 2022-11-28 20:54 ` anlauf at gcc dot gnu.org 2023-06-16 17:01 ` pault at gcc dot gnu.org ` (2 subsequent siblings) 3 siblings, 0 replies; 5+ messages in thread From: anlauf at gcc dot gnu.org @ 2022-11-28 20:54 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107900 anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Last reconfirmed| |2022-11-28 --- Comment #1 from anlauf at gcc dot gnu.org --- Confirmed. ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/107900] Select type with intrinsic type inside associate causes ICE / Segmenation fault 2022-11-28 20:43 [Bug fortran/107900] New: Select type with intrinsic type inside associate causes ICE / Segmenation fault kaiserkarl31 at yahoo dot com 2022-11-28 20:54 ` [Bug fortran/107900] " anlauf at gcc dot gnu.org @ 2023-06-16 17:01 ` pault at gcc dot gnu.org 2023-06-21 16:06 ` cvs-commit at gcc dot gnu.org 2023-06-21 21:05 ` pault at gcc dot gnu.org 3 siblings, 0 replies; 5+ messages in thread From: pault at gcc dot gnu.org @ 2023-06-16 17:01 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107900 Paul Thomas <pault at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at gcc dot gnu.org |pault at gcc dot gnu.org --- Comment #2 from Paul Thomas <pault at gcc dot gnu.org> --- Created attachment 55351 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55351&action=edit Fix for this PR Testcase: ! { dg-do run } ! ! Contributed by Karl Kaiser <kaiserkarl31@yahoo.com> ! program test class(*), pointer :: ptr1, ptr2(:) integer, target :: i = 42 integer :: check = 0 ! ptr1 => NULL() !This would fix the problem associate (c => ptr1) block select type (d => c) type is (integer) stop 1 class default check = 1 end select end block end associate ! Now do the same with the array version ! ptr2 => NULL() !This did not fix the problem associate (c => ptr2) block select type (d => c) type is (integer) stop 2 class default check = check + 10 end select end block end associate if (check .ne. 11) stop 3 end program test Regards Paul ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/107900] Select type with intrinsic type inside associate causes ICE / Segmenation fault 2022-11-28 20:43 [Bug fortran/107900] New: Select type with intrinsic type inside associate causes ICE / Segmenation fault kaiserkarl31 at yahoo dot com 2022-11-28 20:54 ` [Bug fortran/107900] " anlauf at gcc dot gnu.org 2023-06-16 17:01 ` pault at gcc dot gnu.org @ 2023-06-21 16:06 ` cvs-commit at gcc dot gnu.org 2023-06-21 21:05 ` pault at gcc dot gnu.org 3 siblings, 0 replies; 5+ messages in thread From: cvs-commit at gcc dot gnu.org @ 2023-06-21 16:06 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107900 --- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Paul Thomas <pault@gcc.gnu.org>: https://gcc.gnu.org/g:577223aebc7acdd31e62b33c1682fe54a622ae27 commit r14-2022-g577223aebc7acdd31e62b33c1682fe54a622ae27 Author: Paul Thomas <pault@gcc.gnu.org> Date: Wed Jun 21 17:05:58 2023 +0100 Fortran: Fix some bugs in associate [PR87477] 2023-06-21 Paul Thomas <pault@gcc.gnu.org> gcc/fortran PR fortran/87477 PR fortran/88688 PR fortran/94380 PR fortran/107900 PR fortran/110224 * decl.cc (char_len_param_value): Fix memory leak. (resolve_block_construct): Remove unnecessary static decls. * expr.cc (gfc_is_ptr_fcn): New function. (gfc_check_vardef_context): Use it to permit pointer function result selectors to be used for associate names in variable definition context. * gfortran.h: Prototype for gfc_is_ptr_fcn. * match.cc (build_associate_name): New function. (gfc_match_select_type): Use the new function to replace inline version and to build a new associate name for the case where the supplied associate name is already used for that purpose. * resolve.cc (resolve_assoc_var): Call gfc_is_ptr_fcn to allow associate names with pointer function targets to be used in variable definition context. * trans-decl.cc (gfc_get_symbol_decl): Unlimited polymorphic variables need deferred initialisation of the vptr. (gfc_trans_deferred_vars): Do the vptr initialisation. * trans-stmt.cc (trans_associate_var): Ensure that a pointer associate name points to the target of the selector and not the selector itself. gcc/testsuite/ PR fortran/87477 PR fortran/107900 * gfortran.dg/pr107900.f90 : New test PR fortran/110224 * gfortran.dg/pr110224.f90 : New test PR fortran/88688 * gfortran.dg/pr88688.f90 : New test PR fortran/94380 * gfortran.dg/pr94380.f90 : New test PR fortran/95398 * gfortran.dg/pr95398.f90 : Set -std=f2008, bump the line numbers in the error tests by two and change the text in two. ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/107900] Select type with intrinsic type inside associate causes ICE / Segmenation fault 2022-11-28 20:43 [Bug fortran/107900] New: Select type with intrinsic type inside associate causes ICE / Segmenation fault kaiserkarl31 at yahoo dot com ` (2 preceding siblings ...) 2023-06-21 16:06 ` cvs-commit at gcc dot gnu.org @ 2023-06-21 21:05 ` pault at gcc dot gnu.org 3 siblings, 0 replies; 5+ messages in thread From: pault at gcc dot gnu.org @ 2023-06-21 21:05 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107900 Paul Thomas <pault at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #4 from Paul Thomas <pault at gcc dot gnu.org> --- Fixed on trunk and closing. I will build a composite patch for 13-branch in a few weeks. Thanks for the report Paul ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-06-21 21:05 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2022-11-28 20:43 [Bug fortran/107900] New: Select type with intrinsic type inside associate causes ICE / Segmenation fault kaiserkarl31 at yahoo dot com 2022-11-28 20:54 ` [Bug fortran/107900] " anlauf at gcc dot gnu.org 2023-06-16 17:01 ` pault at gcc dot gnu.org 2023-06-21 16:06 ` cvs-commit at gcc dot gnu.org 2023-06-21 21:05 ` pault at gcc dot gnu.org
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).