[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#576864: gfortran-4.4 does not support -Wp, -MD for *.F (4.4 regression, needed for auto-dependencies)



Package: gfortran-4.4
Version: 4.4.2-9
Severity: normal

Hello,

Like with gcc and g++, for compiling .F sources with gfortran, I
thankfully use automatic dependencies generator built into gcc's cpp.

E.g. for

    $ cat test.F
    #include "test.h"

          program test
          print *,'Hello World!'
          print *,ZZZ
          end

    $ cat test.h
    #define ZZZ 'Hello up there qqq!'

gfortran-4.3 correctly generates .d file for make:

    $ gfortran-4.3 -Wp,-MD,test.d test.F
    $ cat test.d
    test.o: test.F test.h

but gfortran-4.4 fails:

    $ rm test.d
    $ gfortran-4.4 -Wp,-MD,test.d test.F
    f951: warning: command line option "-MD" is valid for C/C++/ObjC/ObjC++ but not for Fortran
    $ cat test.d
    cat: test.d: No such file or directory


I think gfortran-4.4 behaviour is incorrect, since .F files (contrast
with .f) by definition should be passed through preprocessor, and if so,
why dropping automatic dependencies generation which worked in 4.3?


I guess the regression is somehow related to the fact, that starting from
gcc-4.4, "GNU Fortran now employs libcpp directly instead of
using cc1 as an external preprocessor." [1]

    $ gfortran-4.3 -v -Wp,-MD,test.d test.F
    Driving: gfortran-4.3 -v -Wp,-MD,test.d test.F -lgfortranbegin -lgfortran -lm -shared-libgcc
    ...
    gcc version 4.3.4 (Debian 4.3.4-6)
    COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic'
     /usr/lib/gcc/i486-linux-gnu/4.3.4/cc1 -E -lang-fortran -traditional-cpp -D_LANGUAGE_FORTRAN -quiet -v -MD test.d test.F -mtune=generic -o /tmp/cclR3nYK.f
    ...
     /usr/lib/gcc/i486-linux-gnu/4.3.4/f951 /tmp/cclR3nYK.f -ffixed-form -quiet -dumpbase test.F -mtune=generic -auxbase test -version -fpreprocessed -fintrinsic-modules-path /usr/lib/gcc/i486-linux-gnu/4.3.4/finclude -o /tmp/cc0ZnWFl.s


(compare to)


    $ gfortran-4.4 -v -Wp,-MD,test.d test.F
    Driving: gfortran-4.4 -v -Wp,-MD,test.d test.F -lgfortranbegin -lgfortran -lm -shared-libgcc
    ...
    gcc version 4.4.3 20100108 (prerelease) (Debian 4.4.2-9)
    COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=i486'
     /usr/lib/gcc/i486-linux-gnu/4.4.3/f951 test.F -ffixed-form -cpp /tmp/ccE2JRYl.f90 -quiet -v -MD test.d test.F -quiet -dumpbase test.F -mtune=generic -march=i486 -auxbase test -version -fintrinsic-modules-path /usr/lib/gcc/i486-linux-gnu/4.4.3/finclude -o /tmp/ccwptNMx.s
    f951: warning: command line option "-MD" is valid for C/C++/ObjC/ObjC++ but not for Fortran



And since -MD was declared to be C/C++/ObjC/ObjC++ only option for ages
(at least since 2003-06-01 d821d2 in gcc.git), now for 4.4. it does not
work. It worked for 4.3 because there `cc1 -E` is explicitly called as
separate step... And for 4.4. calling cc1 explicitly works too

    $ /usr/lib/gcc/i486-linux-gnu/4.4.3/cc1 -E -D_LANGUAGE_FORTRAN -quiet -v -MD test.d test.F -o test.f
    $ cat test.d
    test.o: test.F test.h

but is of no help because cc1 is internal.

--------

Clearly this is functional regression to me. If possible please fix.


Thanks beforehand,
Kirill


[1] http://gcc.gnu.org/gcc-4.4/changes.html
[2] http://git.infradead.org/gcc.git/commit/d821d2e95e00a93f2edb5f6d3decc9c83ceb9c61

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.32.11-roro (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages gfortran-4.4 depends on:
ii  gcc-4.4                   4.4.2-9        The GNU C compiler
ii  gcc-4.4-base              4.4.2-9        The GNU Compiler Collection (base 
ii  libc6                     2.10.2-6       Embedded GNU C Library: Shared lib
ii  libc6-dev                 2.10.2-6       Embedded GNU C Library: Developmen
ii  libgfortran3              4.4.2-9        Runtime library for GNU Fortran ap
ii  libgmp3c2                 2:4.3.2+dfsg-1 Multiprecision arithmetic library
ii  libmpfr1ldbl              2.4.2-3        multiple precision floating-point 

gfortran-4.4 recommends no packages.

Versions of packages gfortran-4.4 suggests:
pn  gfortran-4.4-doc              <none>     (no description available)
pn  gfortran-4.4-multilib         <none>     (no description available)
pn  libgfortran3-dbg              <none>     (no description available)

-- no debconf information



Reply to: