public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/116530] New: ICE with member of namelist renamed by use module
@ 2024-08-29  6:38 philippe.wautelet at cnrs dot fr
  2024-08-29 15:37 ` [Bug fortran/116530] " kargls at comcast dot net
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: philippe.wautelet at cnrs dot fr @ 2024-08-29  6:38 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 116530
           Summary: ICE with member of namelist renamed by use module
           Product: gcc
           Version: 14.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: philippe.wautelet at cnrs dot fr
  Target Milestone: ---

Hello,

The following code triggers an internal compiler error with gfortran 14.1.0 and
14.2.0:
> cat ice_nml_profilern.f90 
module mod_nml1
  logical :: ldiag

  namelist /nam_nml1/ldiag
end module mod_nml1

module mod_nml2
  logical :: ldiag

  namelist /nam_nml2/ldiag
end module mod_nml2

module mod_interm
  use mod_nml1
end module mod_interm

program ice_nml
  use mod_nml1, ldiag_nml1 => ldiag
  use mod_nml2, ldiag_nml2 => ldiag
  use mod_interm

  integer :: ilu

  read(unit=ilu,nml=nam_nml1)
end program ice_nml

> gfortran ice_nml_profilern.f90 
ice_nml_profilern.f90:24:29:

   24 |   read(unit=ilu,nml=nam_nml1)
      |                             1
internal compiler error: Segmentation fault
0xe10cdf crash_signal
        ../../gcc-14.2.0-srcdir/gcc/toplev.cc:319
0x893878 gfc_build_cstring_const(char const*)
        ../../gcc-14.2.0-srcdir/gcc/fortran/trans-const.cc:124
0x8de9eb transfer_namelist_element
        ../../gcc-14.2.0-srcdir/gcc/fortran/trans-io.cc:1696
0x8e0792 build_dt
        ../../gcc-14.2.0-srcdir/gcc/fortran/trans-io.cc:2012
0x872b87 trans_code
        ../../gcc-14.2.0-srcdir/gcc/fortran/trans.cc:2551
0x8a38b4 gfc_generate_function_code(gfc_namespace*)
        ../../gcc-14.2.0-srcdir/gcc/fortran/trans-decl.cc:7880
0x813e26 translate_all_program_units
        ../../gcc-14.2.0-srcdir/gcc/fortran/parse.cc:7099
0x813e26 gfc_parse_file()
        ../../gcc-14.2.0-srcdir/gcc/fortran/parse.cc:7413
0x86fc0f gfc_be_parse_file
        ../../gcc-14.2.0-srcdir/gcc/fortran/f95-lang.cc:241



I'm not sure it is conforming to the Fortran standard but it shouldn't trigger
an ICE.

I think it could be related to the fix for bug 105847.

This code compiles successfully with versions prior to 14.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-08-30 16:32 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-29  6:38 [Bug fortran/116530] New: ICE with member of namelist renamed by use module philippe.wautelet at cnrs dot fr
2024-08-29 15:37 ` [Bug fortran/116530] " kargls at comcast dot net
2024-08-29 17:13 ` [Bug fortran/116530] [14/15 Regression] " anlauf at gcc dot gnu.org
2024-08-29 17:23 ` anlauf at gcc dot gnu.org
2024-08-29 17:32 ` anlauf at gcc dot gnu.org
2024-08-29 18:47 ` kargls at comcast dot net
2024-08-29 19:02 ` kargls at comcast dot net
2024-08-29 19:03 ` anlauf at gcc dot gnu.org
2024-08-29 19:06 ` anlauf at gcc dot gnu.org
2024-08-29 19:23 ` cvs-commit at gcc dot gnu.org
2024-08-29 19:33 ` anlauf at gcc dot gnu.org
2024-08-30 16:20 ` cvs-commit at gcc dot gnu.org
2024-08-30 16:32 ` anlauf 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).