PACK: invalid mask descriptor error when compiling for 64bit

I have the following lines in my code:

xo = matmul(gshape,pack(xe,.true.))

where the dimensions are xo(3), gshape(3,27) and xe(3,27). the pack statement usually reshapes xe into a 1x27 array. Compiling with Lahey, Intel and PGI for 32 bit addressing works fine, but when I try to compile with

pgf90 -mcmodel=medium or
pgf95 -mcmodel=medium,

I get the message

“0: PACK: invalid mask descriptor”

upon execution. I can think of a few ways to get around this, but is this a bug or a result of poor syntax?

thanks

Hi ashlock4,

It looks like a bug to me, but I’ll pass it along to our compiler engineers to be sure. Note that it works correctly without “-Mlarge_arrays” (which is included when you use "-mcmodel=medium). If your arrays are not larger than 2Gb, please add “-Mnolarge_arrays” to the compilation line.

Thanks,
Mat

Thanks for the reply. I am temporarily getting around this problem using xo = matmul(gshape,reshape(xe,(/27/))) .

When I compile with pgf95 -Mipa=fast -mcmodel=medium, however, I get internal compiler errors

PGF90-S-0000-Internal compiler error. ipa_ast:unexpected ast type