I am trying to compile the following code.
module test_mod
implicit none
type fmsDiagAttribute_type
class(*), allocatable :: att_value(:) !< Value of the attribute
contains
procedure :: add => fms_add_attribute
end type fmsDiagAttribute_type
contains
subroutine fms_add_attribute(this, att_value)
class(fmsDiagAttribute_type), intent(inout) :: this !< Diag attribute type
class(*), intent(in) :: att_value(:) !< The attribute value to add
integer :: natt !< the size of att_value
natt = size(att_value)
select type (att_value)
type is (character(len=*))
allocate(character(len=len(att_value)) :: this%att_value(natt))
select type(aval => this%att_value)
type is (character(len=*))
aval = att_value
end select
end select
end subroutine fms_add_attribute
end module test_mod
If I try to compile with v25.1,
$ nvfortran --version
nvfortran 25.1-0 64-bit target on x86-64 Linux -tp znver2
and I use -Mvect
then I get the following error
$ nvfortran -c -Mvect test.f90
NVFORTRAN-F-0000-Internal compiler error. Deferred-length character symbol must have descriptor 730 (test.f90: 27)
NVFORTRAN/x86-64 Linux 25.1-0: compilation aborted
Oddly, I also get this error if I try to combine -O2
with -O0
.
$ nvfortran -c -O2 -O0 test.f90
nvfortran-Info-Switch -Mvect forces -O2
NVFORTRAN-F-0000-Internal compiler error. Deferred-length character symbol must have descriptor 730 (test.f90: 27)
NVFORTRAN/x86-64 Linux 25.1-0: compilation aborted
This was discovered because I was using a wrapper that implicitly sets -O2
, and I explicitly set -O0
.
Adding -Mnovect
also seems to have no effect.
Is this an optimization error? Or just a frontend issue with flags?