Note: This may be related to #40583 (possibly an issue with the installation)

I do observe the behaviour with a gcc/gfortran installed from plain vanilla
upstream in Source Mage GNU/Linux; not with an older gfortran as packaged in
SuSE Linux. So I assume it's either a configuration issue (spec files?) or a
regression from 4.1.2 prerelease.

Simple as that: gfortran does not recognize .f95 files.
Specifically this source, named testf95.f95:

program test

write(*,*) 'this code is on line', 3

end program

Fails to compile with that line:

shell$ LANG=C gfortran -o testf95 testf95.f95 
gfortran: language f95
@c++-header:
%{E|M|MM:cc1plus -E -D_GNU_SOURCE %(cpp_options) %2 %(cpp_debug_options)}
%{!E:%{!M:%{!MM: %{save-temps|no-integrated-cpp:cc1plus -E -D_GNU_SOURCE
%(cpp_options) %2 -o %{save-temps:%b.ii} %{!save-temps:%g.ii} \n} cc1plus
%{save-temps|no-integrated-cpp:-fpreprocessed %{save-temps:%b.ii}
%{!save-temps:%g.ii}}
%{!save-temps:%{!no-integrated-cpp:%(cpp_unique_options)}} %(cc1_options)
-D_GNU_SOURCE %2 %{+e1*} -o %g.s %{!o*:--output-pch=%i.gch}
%W{o*:--output-pch=%*}%V}}} not recognized
gfortran: language f95
@c++-header:
%{E|M|MM:cc1plus -E -D_GNU_SOURCE %(cpp_options) %2 %(cpp_debug_options)}
%{!E:%{!M:%{!MM: %{save-temps|no-integrated-cpp:cc1plus -E -D_GNU_SOURCE
%(cpp_options) %2 -o %{save-temps:%b.ii} %{!save-temps:%g.ii} \n} cc1plus
%{save-temps|no-integrated-cpp:-fpreprocessed %{save-temps:%b.ii}
%{!save-temps:%g.ii}}
%{!save-temps:%{!no-integrated-cpp:%(cpp_unique_options)}} %(cc1_options)
-D_GNU_SOURCE %2 %{+e1*} -o %g.s %{!o*:--output-pch=%i.gch}
%W{o*:--output-pch=%*}%V}}} not recognized
/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.3/../../../../x86_64-pc-linux-gnu/bin/ld:testf95.f95:
file format not recognized; treating as linker script
/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.3/../../../../x86_64-pc-linux-gnu/bin/ld:testf95.f95:1:
syntax error
collect2: ld returned 1 exit status

It's fine with specifying the type of source:

shell$ LANG=C gfortran -xf95 -o testf95 testf95.f95

The automatism works fine for .f90 files, so I suppose it is supposed to work
for .f95, too?

I guess a fix is simple (making that file suffix known). I am rather wondering
why our install of (as far as possible) vanilla upstream gcc does not contain
that configuration, is this something a distribution is supposed to hack in?


-- 
           Summary: gfortran does not recognize .f95 files
           Product: gcc
           Version: 4.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: thomas dot orgis at awi dot de
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40584

Reply via email to