Silverfrost Forums

Welcome to our forums

Access violation writing an array after using MATMUL

30 Oct 2006 8:01 #1172

Hi Paul,

Professor Lassmann reported another bug I have proofed with v4.91 of FTN95. He wrote:

The demonstration program Test_matmul leads to an unexpected error message “Access violation” caused by the statements

tmp = MatMul (b,u)
Write (*,*) 'tmp = ', tmp

The following statement gives the right answer

 Write (*,*) 'tmp = ', tmp (1:2)

He supplied a demo program that shows the error:

Winapp

Program Test_matmul

  Implicit None

  Real , Dimension (1:2,1:2) :: u
  Real , Dimension (1:2    ) :: b, tmp

  u       = +0.

  u (1,1) = -1.
  u (2,2) = -1.

  b       = +0.
  b (1  ) = +1.

  tmp     = +2.

  Write (*,*) 'u   = ', u
  Write (*,*) 'b   = ', b
  Write (*,*) 'tmp = ', tmp
    
  tmp = MatMul (b,u)

! The following statement gives the right answer

! Write (,) 'tmp = ', tmp (1:2)

! The following statement gives 'Access Violation'

  Write (*,*) 'tmp = ', tmp 

End Program Test_matmul

6 Nov 2006 1:09 #1205

Joerg

I have logged this as a compiler bug that needs fixing.

16 Nov 2006 4:54 #1276

Joerg

This bug has now been fixed for the next release.

Regards

Paul

Please login to reply.