title: Result changes when a variable is used in print statement before the computation
body: <p>I have a strange behavior in a fortran subroutine that looks like:</p>
  
  <pre><code>subroutine compute(a, b, c)
      real(8), dimension(:,:), intent(in) :: a
      real(8), dimension(:), intent(in)   :: b
      real(8), dimension(:), intent(in out) :: c
  
      !print*, c
      ! do some computation here to update c
  end subroutine compute
  </code></pre>
  
  <p>If I uncomment the print statement, I get the expected result. If I keep it commented the result becomes very strange with huge numbers. By the way, the print statement got there just for debugging purpose. Strangely, it "solved" the problem, but that is not a reliable solution. The subroutine is part of a large code and I have not yet been able to take the problem out of the context of the large code. The debugger did not help much. It is obvious that the problem is somewhere else, because a print statement is not supposed to change the result of a computation.</p>
  
  <p>My question is: what are the possible mistakes that can lead to such a problem? Had someone had similar problem?</p>