public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gscfq@t-online.de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/99368] New: ICE in build_function_decl, at fortran/trans-decl.c:2381
Date: Wed, 03 Mar 2021 18:04:50 +0000	[thread overview]
Message-ID: <bug-99368-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 99368
           Summary: ICE in build_function_decl, at
                    fortran/trans-decl.c:2381
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

This issue depends on alphabetical order of involved names,
that is, case z1 gives an ICE ("x"<"y"), z2 gives an error.
Special case: same name. Affects versions down to at least r5.


$ diff z1.f90 z2.f90
6c6
<       namelist /x/ y
---
>       namelist /z/ y


$ cat z1.f90
program p
   type y
   end type
contains
   subroutine s
      namelist /x/ y
      character(3) y
   end
end


$ cat z2.f90
program p
   type y
   end type
contains
   subroutine s
      namelist /z/ y
      character(3) y
   end
end


$ gfortran-11-20210228 -c z2.f90
z2.f90:6:17:

    6 |       namelist /z/ y
      |                 1
Error: PROCEDURE attribute conflicts with NAMELIST attribute in 'y' at (1)


$ gfortran-11-20210228 -c z1.f90
z1.f90:2:9:

    2 |    type y
      |         1
internal compiler error: in build_function_decl, at fortran/trans-decl.c:2381
0x752129 build_function_decl
        ../../gcc/fortran/trans-decl.c:2378
0x759a6c gfc_get_symbol_decl(gfc_symbol*)
        ../../gcc/fortran/trans-decl.c:1756
0x75c9a5 generate_namelist_decl
        ../../gcc/fortran/trans-decl.c:5241
0x75ce8e generate_local_nml_decl
        ../../gcc/fortran/trans-decl.c:6147
0x71af42 do_traverse_symtree
        ../../gcc/fortran/symbol.c:4170
0x75d011 generate_local_vars
        ../../gcc/fortran/trans-decl.c:6157
0x75d011 gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:6815
0x75cfe4 gfc_generate_contained_functions
        ../../gcc/fortran/trans-decl.c:5874
0x75cfe4 gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:6812
0x6e3a46 translate_all_program_units
        ../../gcc/fortran/parse.c:6351
0x6e3a46 gfc_parse_file()
        ../../gcc/fortran/parse.c:6620
0x72fd7f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:212

             reply	other threads:[~2021-03-03 18:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-03 18:04 gscfq@t-online.de [this message]
2021-03-03 21:42 ` [Bug fortran/99368] " anlauf at gcc dot gnu.org
2021-08-01 17:04 ` kargl at gcc dot gnu.org
2023-05-29 21:48 ` kargl at gcc dot gnu.org
2023-05-29 21:58 ` kargl at gcc dot gnu.org
2023-07-08 17:13 ` cvs-commit 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-99368-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).