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.

Anyhow: The automatic preprocessing as specified by the documentation, for
files named with capital "F" in the suffix, does not work.
Specifically this source, named testf95.F95:

program test

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

end program

Fails to compile with that line:

LANG=C gfortran -v -o testf95 testf95.F95 
Driving: gfortran -v -o testf95 testf95.F95 -lgfortranbegin -lgfortran -lm
-shared-libgcc
Reading specs from /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.3/specs
Target: x86_64-pc-linux-gnu
Configured with: /usr/src/gcc-4.3.3/configure --prefix=/usr
--infodir=/usr/share/info --mandir=/usr/share/man --enable-threads=posix
--with-system-zlib --enable-languages=f95 --disable-multilib
--build=x86_64-pc-linux-gnu
Thread model: posix
gcc version 4.3.3 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-o' 'testf95' '-shared-libgcc' '-mtune=generic'
 /usr/libexec/gcc/x86_64-pc-linux-gnu/4.3.3/cc1 -E -lang-fortran
-traditional-cpp -D_LANGUAGE_FORTRAN -quiet -v testf95.F95 -mtune=generic -o
/tmp/ccHnRPaP.f95 |n f951 /tmp/ccHnRPaP.f95 -quiet -dumpbase testf95.F95
-mtune=generic -auxbase testf95 -version -fpreprocessed -o /tmp/ccifqF7t.s
cc1: error: output filename specified twice
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.3/../../../../x86_64-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.3/include
 /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.3/include-fixed
 /usr/include
End of search list.
cc1: error: too many filenames given.  Type cc1 --help for usage
GNU C (GCC) version 4.3.3 (x86_64-pc-linux-gnu)
        compiled by GNU C version 4.3.3, GMP version 4.2.4, MPFR version 2.4.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072


It works fine using the two-step procedure:

shell$ cpp -xf95-cpp-input testf95.F95 > testf95.f95
shell$ LANG=C gfortran -xf95 -o testf95 testf95.f95

Note: The second line _needs_ the -xf95 being specified. It fails otherwise.
But since this is not related to preprocessing, I'll create a separate bug.
I am aware of both issues possibly being caused by some missing bits in the
installation of gcc -- in which case I would like to know what we did wrong in
Source Mage. We tried to follow "the" procedure to install from upstream with
minimal hacking.


-- 
           Summary: automatic preprocessing for .F90 or .F95 files fails
                    with cc1 error (output filename specified twice)
           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=40583

Reply via email to