flang-compiler / f18

F18 is a front-end for Fortran intended to replace the existing front-end in the Flang compiler
229 stars 48 forks source link

Perplexing compile time parsing free-form code as fixed-form #880

Open daniel-otero opened 4 years ago

daniel-otero commented 4 years ago

I just found a code that takes an awful amount of time to cause a compilation error (I have to kill the compilation after more than 6 hours).

The code in question is the MG_FLUX_ACCUMULATE.F file from the Mantevo miniGhost proxy-app. Due to the uppercase single character extension, the compiler assumes a fixed-form Fortran file.

Simplifying the code (even shortening the variable names!!) seems to reduce the parse time exponentially. I'm not able do debug any further that that.

All of this was tested with the latest master branch (at commit 0855ba8ba).

klausler commented 4 years ago

The use of upper-case in a file extension indicates a need for preprocessing in most compilers, not fixed-form. Fixed-form is implied by the single letter f, upper-case or not.

daniel-otero commented 4 years ago

The use of upper-case in a file extension indicates a need for preprocessing in most compilers, not fixed-form. Fixed-form is implied by the single letter f, upper-case or not.

It's now corrected, thanks.

The problem is still the same no matter the extension. The -Mfixed will do the job.