https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62162
Bug ID: 62162 Summary: Gfortran produces incorrect dependency files when using -MQ Product: gcc Version: 4.9.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: jpakkane at gmail dot com Create a simple Fortran file stuff.f95 that looks like this: MODULE Circle REAL, PARAMETER :: Pi = 3.1415927 REAL :: radius END MODULE Circle Then compile it with this: gfortran -cpp -MD -MQ stuff.f95.o -o stuff.f95.o -c stuff.f95 Then print the output of the dependency file, which looks like this: stuff.o stuff.f95.o circle.mod: stuff.f95 The bug here is that Gfortran writes both the default target (stuff.o) and the one specified with -MQ (stuff.f95.o). It should only print the latter. The same happens if you use -MT instead of -MQ.