CUDA Fortran Internal Compiler Error

When compiling my current project I get the message “Internal compiler error. unsupported operation 285”. Unfortunately, the line number given doesn’t correspond to any program statement (it’s just past the end of the subroutine), and I haven’t been able to find any mention in the compiler manual of what “unsupported operation 285” actually is. Is there a index somewhere of these error codes, so that I can figure out what the offending operation is in my program and fix it?

Hi Robert,

Internal compiler errors (aka ICE) are problems with the compiler. Granted most of the ICEs that I’ve seen recently are due to some type of coding error, but the compiler should be giving you a syntax or semantic error, not an ICE.

Please send a report to PGI Customer Service ( and include a reproducing example.



The full code is rather lengthy, and there are a lot of module dependences, so I can’t just extract the offending subroutine. Is there any information available about what differentiates “unsupported operation 285” from, say, “unsupported operation 311” (the latter being most common variant that turned up in my search for the term)? That might help me narrow down the source of the problem more quickly, so that I can produce a self-contained example of the bug.


Hi Robert,

While I’ll need to ask a compiler engineer what “285” is, I do see a bug report for “311”. In this case, the user was using automatic arrays within a device kernel. Since allocation from device code is not allowed and automatic arrays are implicitly allocated, automatics are not allowed as well. In 10.4, we added a syntax error for this case.

Which version of the compiler are you using? If it’s 10.4 or 10.5, then your “311” is something different. If you’re using an earlier version, please try 10.5.



Sorry for the confusion. I am not getting a 311; that was just what I found discussed in the archive. I’m only getting the 285.

Here is a reduced version of the code that reproduces the failure:

module fail
  use cudafor

  implicit none

  integer, parameter :: ICS=1
  integer, parameter :: NMTRATE=402
  integer, parameter :: NCELL=10240

  integer, constant :: irma(NMTRATE,ICS), irmb(NMTRATE, ICS), &
       &               irmc(NMTRATE, ICS)
  real(KIND=rkind), device :: rrate(NCELL,NMTRATE)
  real(KIND=rkind), device :: trate(NCELL,2*NMTRATE)
  attributes(device) subroutine subfun(indx, ncs, nfdh3, nallr, sfconc, nc1, mxg1)
    integer, value :: indx
    integer, shared :: ncs,nfdh3, nallr
    integer, value :: nc1,mxg1
    real(KIND=rkind), device :: sfconc(nc1,mxg1)   ! concentration values
    integer :: ja,jb,jc, jspc
    integer :: nkn, nh,nc
    real(KIND=rkind) :: fracn, tr

    !! First derivatives for rates with three active loss terms
    do nkn = 1,nfdh3(ncs)      ! loop over reactions
       !! indices of reactants
       ja = irma(nkn,ncs)
       jb = irmb(nkn,ncs)
       jc = irmc(nkn,ncs)

       nh = nkn + nallr
       tr = rrate(indx,nkn) * sfconc(indx,ja) * sfconc(indx,jb) * sfconc(indx,jc)
       trate(indx,nkn) = tr
       trate(indx,nh) = -tr
    end do

  end subroutine subfun

end module fail

The output is as follows:

~/wrk/test% pgf90 -g -O -c fail.cuf
PGF90-F-0000-Internal compiler error. unsupported operation 285 (fail.cuf: 43)
PGF90/x86-64 Linux 10.3-0: compilation aborted

I’ve sent a copy to the customer service address you provided.


Hi Robert,

The problem is this declaration:

integer, shared :: ncs,nfdh3, nallr

“nfdh3” is an array but is being declared as a shared scalar integer.

While it’s not causing the error, you most likely also want ncs and nallr declared as ‘value’ instead of shared.

integer, value :: ncs, nallr
integer, allocatable(:) :: nfdh3

I have submitted a problem report to our engineers, TPR#17027, asking that we flag this error.

Thanks for the sample code and report.

  • Mat