public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "roland_wirth at web dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/102241] New: ICE when declaring derived type with a parameterized derived type member
Date: Wed, 08 Sep 2021 15:21:47 +0000	[thread overview]
Message-ID: <bug-102241-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 102241
           Summary: ICE when declaring derived type with a parameterized
                    derived type member
           Product: gcc
           Version: 9.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: roland_wirth at web dot de
  Target Milestone: ---

The following code triggers an ICE in gfortran 9.1.0

    MODULE mo
      TYPE t1(n)
        INTEGER, LEN :: n
        INTEGER :: a(n)
      END TYPE

      TYPE t2
        TYPE(t1(1)) :: p_t1
      END TYPE
    END MODULE

f951: internal compiler error: in gfc_get_derived_type, at
fortran/trans-types.c:2519
0x586d70 gfc_get_derived_type(gfc_symbol*, int)
        ../.././gcc/fortran/trans-types.c:2519
0x715384 gfc_get_derived_type(gfc_symbol*, int)
        ../.././gcc/fortran/trans-types.c:2670
0x715cd8 gfc_typenode_for_spec(gfc_typespec*, int)
        ../.././gcc/fortran/trans-types.c:1166
0x71601c gfc_sym_type(gfc_symbol*)
        ../.././gcc/fortran/trans-types.c:2247
0x71601c gfc_sym_type(gfc_symbol*)
        ../.././gcc/fortran/trans-types.c:2205
0x6bf0a2 gfc_get_symbol_decl(gfc_symbol*)
        ../.././gcc/fortran/trans-decl.c:1718
0x6c2178 gfc_create_module_variable
        ../.././gcc/fortran/trans-decl.c:5140
0x6c2178 gfc_create_module_variable
        ../.././gcc/fortran/trans-decl.c:5057
0x684912 do_traverse_symtree
        ../.././gcc/fortran/symbol.c:4166
0x6c2943 gfc_generate_module_vars(gfc_namespace*)
        ../.././gcc/fortran/trans-decl.c:5639
0x69f589 gfc_generate_module_code(gfc_namespace*)
        ../.././gcc/fortran/trans.c:2193
0x650285 translate_all_program_units
        ../.././gcc/fortran/parse.c:6121
0x650285 gfc_parse_file()
        ../.././gcc/fortran/parse.c:6337
0x6990ef gfc_be_parse_file
        ../.././gcc/fortran/f95-lang.c:204
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

The error persists when adding the POINTER attribute to p_t1 and when deferring
the type parameter (TYPE(t1(:))). Also for the invalid declaration with
deferred parameter, but without POINTER.

             reply	other threads:[~2021-09-08 15:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-08 15:21 roland_wirth at web dot de [this message]
2022-10-21 10:24 ` [Bug fortran/102241] " massoustephane at gmail dot com
2022-10-21 17:07 ` [Bug fortran/102241] [PDT] " anlauf at gcc dot gnu.org
2023-06-30  8:25 ` pault at gcc dot gnu.org
2024-05-10 17:30 ` oliverjahn at proton dot me

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-102241-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).