https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105954
--- Comment #4 from anlauf at gcc dot gnu.org --- Anyway, there's likely an ordering issue looking at array bounds and using them. Moving the type decl to a module, the problem seems to disappear: module m implicit none integer, parameter :: n = -1 real :: a(3,2:n) type t real :: b(3,2:n) end type end module m program p use m implicit none type(t) :: d integer, parameter :: k = sizeof(a) integer, parameter :: j = sizeof(d) integer, parameter :: l = storage_size(d) end This compiles and produces the right numbers.