public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "anlauf at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/113363] New: ICE on ASSOCIATE and unlimited polymorphic function
Date: Fri, 12 Jan 2024 20:31:05 +0000	[thread overview]
Message-ID: <bug-113363-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113363

            Bug ID: 113363
           Summary: ICE on ASSOCIATE and unlimited polymorphic function
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anlauf at gcc dot gnu.org
  Target Milestone: ---

While discussing a patch for PR89645/99065, the following issue with
ASSOCIATE and unlimited polymorphic functions was found:

https://gcc.gnu.org/pipermail/fortran/2024-January/060098.html

program p
  implicit none
  class(*), allocatable :: x(:)
  x = foo()
  call prt (x)
  deallocate (x)            ! up to here all is fine...
  associate (var => foo())  ! <- crash here
    call prt (var)          ! <- or here
  end associate
contains
  function foo() result(res)
    class(*), allocatable :: res(:)
    res = [42]
  end function foo
  subroutine prt (x)
    class(*), intent(in) :: x(:)
    select type (x)
    type is (integer)
       print *, x
    class default
       stop 99
    end select
  end subroutine prt
end


This ICEs on current trunk for any of the indicated statements.

             reply	other threads:[~2024-01-12 20:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-12 20:31 anlauf at gcc dot gnu.org [this message]
2024-01-14  8:54 ` [Bug fortran/113363] " pault at gcc dot gnu.org
2024-01-14  9:22 ` pault at gcc dot gnu.org
2024-01-17 14:46 ` pault at gcc dot gnu.org
2024-04-03 18:56 ` anlauf at gcc dot gnu.org
2024-04-04  6:27 ` pault at gcc dot gnu.org
2024-04-04 19:12 ` anlauf at gcc dot gnu.org
2024-04-06 10:05 ` pault at gcc dot gnu.org
2024-05-07  7:43 ` rguenth at gcc dot gnu.org
2024-05-13  6:27 ` cvs-commit at gcc dot gnu.org
2024-05-13  6:37 ` pault at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-113363-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).