public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "juergen.reuter at desy dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/114475] New: [14.0 Regression] Regression with iso_c_binding and submodules
Date: Mon, 25 Mar 2024 23:10:38 +0000	[thread overview]
Message-ID: <bug-114475-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 114475
           Summary: [14.0 Regression] Regression with iso_c_binding and
                    submodules
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: juergen.reuter at desy dot de
  Target Milestone: ---

Between ca. March 18 and March 25, a regression has been introduced into the
gfortran 14.0.1 code, which makes the following valid code fail to compile, cf.
below:
gfortran  -c t1.f90
t1.f90:28:13:

   28 | submodule (t1) t1_s
      |             1
Error: Variable ‘n_external’ cannot appear in the expression at (1)

It would be cool if that could be fixed before the release of gcc 14.1 which I
believe is very soon. 



module t1
  use, intrinsic :: iso_c_binding !NODEP!                                       
  implicit none
  private
  public :: t1_t
  integer :: N_EXTERNAL = 0

  type :: t1_t
  contains
    procedure :: set_n_external => t1_set_n_external
  end type t1_t

  abstract interface
     subroutine ol_eval (id, pp, emitter) bind(C)
       import
       real(kind = c_double), intent(in) :: pp(5 * N_EXTERNAL)
     end subroutine ol_eval
  end interface
  interface
    module subroutine t1_set_n_external (object, n)
      class(t1_t), intent(inout) :: object
      integer, intent(in) :: n
    end subroutine t1_set_n_external
  end interface

end module t1

submodule (t1) t1_s
  implicit none
contains
  module subroutine t1_set_n_external (object, n)
    class(t1_t), intent(inout) :: object
    integer, intent(in) :: n
    N_EXTERNAL = n
  end subroutine t1_set_n_external

end submodule t1_s

             reply	other threads:[~2024-03-25 23:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-25 23:10 juergen.reuter at desy dot de [this message]
2024-03-25 23:17 ` [Bug fortran/114475] " juergen.reuter at desy dot de
2024-03-26  8:06 ` [Bug fortran/114475] [14 " rguenth at gcc dot gnu.org
2024-03-26 17:48 ` anlauf at gcc dot gnu.org
2024-03-26 19:23 ` anlauf at gcc dot gnu.org
2024-03-26 21:03 ` mikael at gcc dot gnu.org
2024-03-28 10:40 ` cvs-commit at gcc dot gnu.org
2024-04-02 13:14 ` mikael 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-114475-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).