public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pault at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/114535] [13/14 regression] ICE with elemental finalizer
Date: Mon, 01 Apr 2024 11:38:14 +0000	[thread overview]
Message-ID: <bug-114535-4-AgCGZaD5Z1@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114535-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from Paul Thomas <pault at gcc dot gnu.org> ---
Created attachment 57839
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57839&action=edit
"Fix" for this PR

Even though no entities of type 'vs' are being referenced in subroutine iss,
gfortran currently feels the need to generate a final wrapper for it. The
comment in the patch explains what is happening but not why. I suspect that the
evil is being done somewhere in resolve.cc and will investigate in another
session.

Note the comments in the testcase below:

module d
  implicit none
contains
  function en() result(dd)
    use :: iv
    implicit none
    type(vs) :: dd
    dd%i = 1
  end function en
end module d

! Comment out line 1 and all brands complain that 'vs' is an undefined type
! Comment out line 1 and line 2 allows compilation to proceed (with fix for
gfortran)
module ni
  implicit none
contains
  subroutine iss()
    use :: iv                                        ! line 1
    use :: d
    implicit none
    type(vs) :: ans; ans = en(); print *, ctr, ans%i ! line 2
  end subroutine iss
end module ni

  use ni
  call iss()
  call iss()
!  print *, ctr
end

  parent reply	other threads:[~2024-04-01 11:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-31  6:59 [Bug fortran/114535] New: " abensonca at gcc dot gnu.org
2024-03-31 11:43 ` [Bug fortran/114535] " pault at gcc dot gnu.org
2024-03-31 11:50 ` [Bug fortran/114535] [13/14 regression] " pault at gcc dot gnu.org
2024-03-31 16:33 ` abensonca at gcc dot gnu.org
2024-04-01 11:38 ` pault at gcc dot gnu.org [this message]
2024-04-02 11:30 ` rguenth at gcc dot gnu.org
2024-04-09 14:27 ` cvs-commit at gcc dot gnu.org
2024-05-08  8:03 ` [Bug fortran/114535] [13 " cvs-commit at gcc dot gnu.org
2024-05-08  8:04 ` 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-114535-4-AgCGZaD5Z1@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).