Issue 117712
Summary Flang error parsing fixed form fortran source with `-save-temps`
Labels flang
Assignees
Reporter macurtis-amd
    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
...
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to