title: Msys2 -> f951.exe: Fatal Error: Reading module '...' at line 2 column 1: Unexpected EOF
body: <p>I am trying to use a module with <strong>gfortran 8.2.0 under Win 10 + Portable Msys2</strong>.
  This problem does not show up with <strong>gfortran 7.3.0 under Ubuntu 18.04LTS</strong>.
  After failing to compile my actual case, I put together</p>
  
  <p><strong>My <a href="https://en.wikipedia.org/wiki/Minimal_working_example" rel="nofollow noreferrer">MWE</a> or <a href="https://stackoverflow.com/help/mcve">MCVE</a></strong>:</p>
  
  <ul>
  <li><p><code>main.f90</code>:</p>
  
  <pre><code>program main_prog
  use testmod
  implicit none
  integer :: j
  end program main_prog
  </code></pre></li>
  <li><p><code>mod_testmod.f90</code>:</p>
  
  <pre><code>module testmod
  implicit none
  &lt;various statements&gt;
  end module testmod
  </code></pre>
  
  <p>depending on the contents of <code>&lt;various statements&gt;</code>, compilation worked or failed (see below).</p></li>
  </ul>
  
  <p><strong>Compilation</strong></p>
  
  <ul>
  <li><p><code>mod_testmod.f90</code>: Compiled ok, regardless of the combinations that I used for <code>&lt;various statements&gt;</code> (<code>mod_testmod.o</code> and <code>testmod.mod</code> were created with no errors):</p>
  
  <pre><code>$ gfortran -g -c -o mod_testmod.o mod_testmod.f90
  </code></pre></li>
  <li><p><code>main.f90</code>: 
  <code>&lt;various statements&gt;</code> (in <code>mod_testmod.f90</code>!) consisted of a few variable definitions:</p>
  
  <pre><code>integer :: Npuntos=10             ! def 1
  double precision :: PI=3.1415296  ! def 2
  double precision :: T=4.0         ! def 3
  double precision :: T0=4.0        ! def 4
  double precision :: S0=4.0        ! def 5
  </code></pre>
  
  <p>which were commented/uncommented. Depending on the combination, compilation worked or failed (it completely puzzles me, all should work).
  When failed, the error message was</p>
  
  <pre><code>$ gfortran -g -c -o main.o main.f90
  f951.exe: Fatal Error: Reading module 'testmod' at line 34 column 62: Unexpected EOF
  compilation terminated.
  </code></pre>
  
  <p>I wouldn't know if the line/column combination is of any use to track the problem.</p>
  
  <p>Combinations of unocmmented definitions that worked:
  (1), 
  (1,4,5), 
  (2,4,5), 
  (3,4,5), 
  (1,2,3,4), 
  (1,2,4,5), </p>
  
  <p>Combinations of unocmmented definitions that failed:
  (none) (comment by High Performance Mark was right), 
  (4,5), 
  (1,3,4,5), 
  (1,2,3,4,5), </p>
  
  <p>These are the combinations I tried, enough to have me completely lost on what's going on.</p></li>
  </ul>
  
  <p><strong>How can I solve this?</strong></p>