C_LOC in an array constructor causes internal compiler error

When compiling the code:

use iso_c_binding

INTEGER(C_INT), DIMENSION(1:1), TARGET :: A = (/1/)
INTEGER(C_INT), DIMENSION(1:1), TARGET :: B = (/2/)
TYPE(C_PTR), DIMENSION(1:1,1:2), TARGET :: wdata2D

wdata2D(1,1) = C_LOC(A(1))
wdata2D(1,2) = C_LOC(B(1))

! remove this line and it compiles fine
wdata2D(1,1:2) = (/C_LOC(A(1)), C_LOC(B(1))/)

end

Produces the error:

Lowering Error: unknown target type for conversion [ast=97,asttype=7,datatype=56]
Lowering Error: target type was 56
PGF90-F-0000-Internal compiler error. Errors in Lowering 2 (test3.f90: 12)
PGF90/x86 Linux 11.7-0: compilation aborted

I have replicated this problem and logged itas TPR 18144

I have asked for a workaround from engineering.

thanks,
dave

We have fixed the your reported problem.

TPR 18144 - ISO_C_BINDING problem gets ICE ‘unknown target type for conversion’

thanks for the report.

dave