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

            Bug ID: 122191
           Summary: ICE on function interface body with composite PDT
                    result
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: damian at archaeologic dot codes
  Target Milestone: ---

The difference between the code below and PR 122109 include that generating the
ICE below requires

1. Only two types,
2. An interface body
3. An allocatable array component

$ cat reproducer.f90 
module input_output_pair_m
  implicit none

  type input_output_pair_t(k)
    integer, kind :: k
  end type

  type mini_batch_t(k)
    integer, kind :: k = kind(1.)
    type(input_output_pair_t(k)), allocatable :: input_output_pairs_(:)
  end type

  interface

    module function default_real_construct()
      implicit none
      type(mini_batch_t) default_real_construct
    end function

  end interface

end module

$ gfortran -c reproducer.f90 
reproducer.f90:22:10:

   22 | end module
      |          ^
internal compiler error: in gimplify_var_or_parm_decl, at gimplify.cc:3354
0x25fa14b internal_error(char const*, ...)
        ../../trunk/gcc/diagnostic-global-context.cc:786
0xa022f2 fancy_abort(char const*, int, char const*)
        ../../trunk/gcc/diagnostics/context.cc:1803
0x8334e7 gimplify_var_or_parm_decl
        ../../trunk/gcc/gimplify.cc:3354
0xed52ff gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../trunk/gcc/gimplify.cc:20751
0xef680b gimplify_modify_expr
        ../../trunk/gcc/gimplify.cc:7359
0xed503a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../trunk/gcc/gimplify.cc:20284
0xed88fa gimplify_stmt(tree_node**, gimple**)
        ../../trunk/gcc/gimplify.cc:8575
0xed56ab gimplify_statement_list
        ../../trunk/gcc/gimplify.cc:2293
0xed56ab gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../trunk/gcc/gimplify.cc:20735
0xed88fa gimplify_stmt(tree_node**, gimple**)
        ../../trunk/gcc/gimplify.cc:8575
0xef51f4 gimplify_cond_expr
        ../../trunk/gcc/gimplify.cc:5663
0xed6d7b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../trunk/gcc/gimplify.cc:20238
0xed88fa gimplify_stmt(tree_node**, gimple**)
        ../../trunk/gcc/gimplify.cc:8575
0xed56ab gimplify_statement_list
        ../../trunk/gcc/gimplify.cc:2293
0xed56ab gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../trunk/gcc/gimplify.cc:20735
0xed88fa gimplify_stmt(tree_node**, gimple**)
        ../../trunk/gcc/gimplify.cc:8575
0xed9ed4 gimplify_bind_expr
        ../../trunk/gcc/gimplify.cc:1688
0xed5b80 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../trunk/gcc/gimplify.cc:20485
0xed88fa gimplify_stmt(tree_node**, gimple**)
        ../../trunk/gcc/gimplify.cc:8575
0xef51f4 gimplify_cond_expr
        ../../trunk/gcc/gimplify.cc:5663
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ gfortran --version
GNU Fortran (GCC) 16.0.0 20251002 (experimental)

Reply via email to