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

            Bug ID: 128565
           Summary: ICE when using storage_size with array sections
           Product: gcc
           Version: 16.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: henri at henrimenke dot de
  Target Milestone: ---

The code example below triggers an ICE with most (all?) versions of gfortran.
This was previously reported for different arguments to storage_size, but the
fixes remained incomplete:

1. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84006
2. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100027

Live example: https://godbolt.org/z/hT4EnYePY


program ice
  type :: t
  end type t
  class(t), allocatable :: a(:)
  print *, storage_size(a(1:2))
end program ice


internal compiler error: in gfc_conv_intrinsic_storage_size, at
fortran/trans-intrinsic.cc:8658

Reply via email to