Internal compiler error

Although far removed from the original code, this produces the internal compiler error, and if I change almost any line in it it compiles so I have been unable to reduce it further (but it started at 18 000+ lines):

function help_intrinsics_one(name) result (textblock)
character(len=*),intent(in)      :: name
logical                          :: topic
character(len=256),allocatable   :: textblock(:)
character(len=:),allocatable     :: shortname
topic=.true.
select case(name)
case('abs')
   textblock=[character(len=256) :: '']
   shortname="abs"
   call process()
case default
   allocate (character(len=256) :: textblock(0))
end select
contains
subroutine process()
if(topic)then
   textblock=[shortname]
else
   textblock=[character(len=len(textblock)) :: ' ',textblock] 
endif
end subroutine process
end function help_intrinsics_one

NVFORTRAN-S-0000-Internal compiler error. Scale_Of:bad dtype       0  (nv_bug.f90: 18)
NVFORTRAN-S-0000-Internal compiler error. Scale_Of: bad dtype        0  (nv_bug.f90: 18)
NVFORTRAN-S-0000-Internal compiler error. Scale_Of:bad dtype       0  (nv_bug.f90: 18)
NVFORTRAN-S-0000-Internal compiler error. Scale_Of: bad dtype        0  (nv_bug.f90: 18)
  0 inform,   0 warnings,   4 severes, 0 fatal for process

Thanks urbanjost. I was able to recreate the issue here and have sent it to engineering for investigation. Filed as TPR#31169.

-Mat

Great. Thanks!

Hi urbanjost,

While our engineers are still investigating a fix, they want me to let you know that you can work around the error by changing the line:

textblock=[shortname]

to:

textblock=shortname

Hope this helps in the short term,
Mat

Thanks, but that cannot be applied to the actual code, which is much more complex. It took a long time to get the rrror to reproduce on something short so the remaining code is just a reproducer and does not make much sense other than it generates what looks like the same error without being 20 000, lines long.