In looking through our problem reports, I do see a similar error (TPR#15708) from the 8.0-6 compiler which was corrected in the 9.0-1 release. The error occurred when using the “TRIM” intrinsic when building a string being passed to a subroutine. For example:
call error_msg ( (/"message"//trim(arg) /) )
While I don’t know if this is indeed the same error that you’re encountering, can you please try a 9.0 or later compiler?