Internal compiler error. Errors in Lowering

Hi

I’m using Fortran/PGI/win64/18.4

I changed a program by using array of structures instead of structure of array in some places. Therefore I introduced some very simple types.

Since then the compiler gives an error-message:

Lowering Error: bad ast optype in expression [ast=1669,asttype=12,datatype=0]
Lowering Error: bad ast optype in expression [ast=1669,asttype=12,datatype=0]
Lowering Error: bad ast optype in expression [ast=1662,asttype=12,datatype=0]
Lowering Error: bad ast optype in expression [ast=1662,asttype=12,datatype=0]
Lowering Error: bad ast optype in expression [ast=1662,asttype=12,datatype=0]
Lowering Error: bad ast optype in expression [ast=1691,asttype=12,datatype=0]
Lowering Error: bad ast optype in expression [ast=1691,asttype=12,datatype=0]
Lowering Error: bad ast optype in expression [ast=1669,asttype=12,datatype=0]
Lowering Error: bad ast optype in expression [ast=1669,asttype=12,datatype=0]
Lowering Error: bad ast optype in expression [ast=1662,asttype=12,datatype=0]
Lowering Error: bad ast optype in expression [ast=1662,asttype=12,datatype=0]
Lowering Error: bad ast optype in expression [ast=1662,asttype=12,datatype=0]
Lowering Error: bad ast optype in expression [ast=1691,asttype=12,datatype=0]
Lowering Error: bad ast optype in expression [ast=1691,asttype=12,datatype=0]
PGF90-F-0000-Internal compiler error. Errors in Lowering      14  (u:/ws/trunk2/AS\Hydro_AS.f90: 1277)
PGF90/x86-64 Windows 18.4-0: compilation aborted

u:/ws/trunk2/AS\Hydro_AS.f90: 1277 is

            READ(IWR33,END=833)vcpr

and is not part of the changes at all.

Any advice what I can do?

Benedikt

Hi Benedikt,

This is a generic internal compiler error where something in the modified code is causing it to go down a bad path. The problem may or may not actually be occurring at line 1277 so it’s difficult to know if it’s actually the use of “vcpr” in a read statement that’s causing the problem.

Can you either post or send the PGI Customer Service (support@pgroup.com) a reproducing example?

We’ll then get one of our compiler engineers to take a look and get the issue fixed.

Thanks!
Mat

I found the source of the compiler-crash on my own.

Old code - didn’t crash the compiler

REAL, allocatable:: X(:)
REAL, allocatable:: Y(:)
...
!$acc update host(X(1:n),Y(1:n))
...

New code - did crash the compiler

TYPE Coord
  REAL X
  REAL Y
End Type

TYPE(Coord), allocatable:: XY(:)
...
! CAUSES PGI-FORTRAN TO CRASH
!$acc update host(XY(1:n)%X,XY(1:n)%Y)
...

mmh - this strange update-line came up through an automized code-rewrite. For shure I want to write

!$acc update host(XY(1:n))

With this line no more crash occures.

Crashing compilers are uncool. Will the PGI-guys fix it?

Benedikt

Crashing compilers are uncool.

Agreed. We don’t want this to happen either. While not they don’t happen often, we do appreciate it when users bring these issues to our attention.

Will the PGI-guys fix it?

Yes, provided we can reproduce the error. Fortunately, you gave me enough info that I would pull one together.

% cat test_ice.F90

program foo

TYPE Coord
  REAL X
  REAL Y
End Type

TYPE(Coord), allocatable:: XY(:)
integer :: n,i

n = 32

allocate(XY(n))

!$acc enter data create(XY(:n))

! CAUSES PGI-FORTRAN TO CRASH
!$acc update host(XY(1:n)%X,XY(1:n)%Y)

end program foo
% pgf90 test_ice.F90 -ta=tesla
Lowering Error: bad ast optype in expression [ast=47,asttype=12,datatype=0]
Lowering Error: bad ast optype in expression [ast=47,asttype=12,datatype=0]
PGF90-F-0000-Internal compiler error. Errors in Lowering       2  (test_ice.F90: 21)
PGF90/x86-64 Linux 19.1-0: compilation aborted

I’ve added TPR #27021 to track this issue and sent it on to our compiler engineers for further investigation.

Note even when fixed, you may consider updating the entire type array rather than a single member. With the entire array, the runtime can copy the data as one large block. If you only copy a single member, the runtime will need to traverse the array, performing a separate copy of each member. This will have a severe performance penalty.

Best Regards,
Mat