PGF90-F-0000-Internal compiler error. set_assumed_bounds: arg not deferred

Have spent some time trying to get a reproducer for this error:

PGF90-F-0000-Internal compiler error. set_assumed_bounds: arg not deferred

with no luck so far. Anything small enough to send, the error disappears. This is with Fortran 20.1 as well as an earlier version (19.10). Another compiler (Intel) is happy with the code.

The code that’s causing the error is in the interface definition for a type-bound procedure:

  module subroutine cart2sph_vector(this,q0)
    implicit none
    class(rotate_t),       intent(inout) :: this
    real(kind=r8),         intent(inout) :: q0(:,:)
  end subroutine cart2sph_vector

If I comment out the second argument, q0, and its declaration statement, the problem goes away. I will keep trying to come up with a reproducer, but in the meantime let me please ask: is this legal Fortran in the first place? That is, is it legal to have a deferred-shape dummy array argument in the interface of a type-bound procedure? (The type is not declared as abstract).

Thanks for your advice.

Hi John,

I consulted with some folks here that said the code is indeed legal. Though he notes:

Also to clarify, they’re using an assumed-shape array argument, not a deferred-shape array argument. Arrays declared allocatables/pointer are deferred-shape.

The ICE is misleading in that it says “arg not deferred”. But that’s probably due to a problem with the compiler, not their code.

Since you’re having issues reproducing the problem in an example code, can you provide more context about the code? For example, provide a module body with a derived type definition with the type bound procedure and the module subroutine interface?


Hi Mat,
Thanks for the reply and clarification on the terminology.
I will send additional context in an email. Thank you,
PS. Hope you’re all well.