<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/117712>117712</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Flang error parsing fixed form fortran source with `-save-temps`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            flang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          macurtis-amd
      </td>
    </tr>
</table>

<pre>
    Here is the problematic fixed form fortran source `reduced.f`: 
```
      subroutine foo(a, b)
      if ( (a  .eq. 0) .and.
     >     (b . eq. 1) ) then
 print *, "foo"
      end if
      end subroutine
```
Prior to [9fb2db1](https://github.com/llvm/llvm-project/commit/9fb2db1e1f42ae10a9d8c1d9410b5f4e719fdac0) `flang -save-temps -c` produced `reduced.i`:
```
      subroutine foo(a, b)
      if ( (a  .eq. 0) .and.(b.eq.1))then

         print *, "foo"
 end if
      end subroutine
```

With [9fb2db1](https://github.com/llvm/llvm-project/commit/9fb2db1e1f42ae10a9d8c1d9410b5f4e719fdac0), `flang -save-temps -c` produces `reduced.i`:
```
      subroutine foo(a, b)
      if ( (a  .eq. 0) .and.(b. eq. 1)) then

         print *, "foo"
      end if
      end subroutine
```

Which produces:
```
error: Could not parse reduced.i
./reduced.f:2:31: error: expected ')'
        if ( (a  .eq. 0) .and.(b. eq. 1)) then
 ^
...
```

In either case the commands produced by the driver look like:
```
flang -fc1 -E -o reduced.i -x f95-cpp-input reduced.f
flang -fc1 -emit-llvm-bc ... -o reduced.bc -x f95 reduced.i
...
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzElU2TozYQhn-NuHRBSc33gQO7M67kllvOQmqMsoCIJCaz_z4lxuuPTNUmk6pkXcZgu6Xu99GrlvTenFeijpWfWPmUyD1M1nWLVLsLxqdy0clg9dfuJ3IExkOYCDZnh5kWGYyC0byShtG6JX4EJ1fwdneKgFXckd4V6WxkFWd5D4z38entzXs4Xn4fnN2DWQlGaxk2kuFnGBi21xAzAsMmXhIgo98z4AxbyOSqs29BLH9-u2MzQAYxSMSgeIWJ1hi3ObMGYNjHDAzxyIfXNLRqMOPD11txf6n9F2esg2CBlZ_acUA9CFY-MWymEDbP8p7hieHpbMK0D5myC8PTPL98u6Wbs7-RCgxPyi6LiQ-XaUiMBUoSXLa6UUK3heBDORZUi3bUUh3SWcXHWa5nSL18oTTQsnlIFat4XJ2D-v0CmLcF-E_4YzPEnyJshu0F9XUowHeofwQ44_2vJkw_hvdR-d8i9_8n8qvD7wz-z6h_2OsR_WTUdNX5Xhc5Z13c4p_tPmtYbYBNOk9ww8H7jOHp1hLyHlne5yKOug6n141UiObF-tBW32n6V0yAlc8xd5a9V_XzCmTCRA6U9HT0tugOuWp_20bD1-MP7cwLOZit_QKz-ULvGVzcMSoB6TOk9qYd0lcY2zJV25aaddsD3DA8jqPFhPQw7KAgy7L7aQZ1mecR6qOwRHe5bvNWJtSJOscKGy7qZOqw1nXRNvUgNI6iLqpGq6Yt6kHpphmLKjEdciyEwErkeZ7XGa_KRsqWxkqUggpkBadFmjmL9WXWnRPj_U6dEHUtMJnlQLM_DhLEQ1P0W_mUuO5N0H72rOCz8cHfpggmzNSdDgSHCw7fmPX8nZPlj6MPVPxuI0blu5u7D3eDQ4JneLqoeOnwzwAAAP__2asJ-g">