https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485
--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jerry DeLisle <jvdeli...@gcc.gnu.org>: https://gcc.gnu.org/g:e41a5a2a0832509fa1c0b7cab0c8001fadbd23d4 commit r15-7365-ge41a5a2a0832509fa1c0b7cab0c8001fadbd23d4 Author: Jerry DeLisle <jvdeli...@gcc.gnu.org> Date: Tue Feb 4 17:21:42 2025 -0800 Fortran: Fix PR 47485. The -MT and -MQ options should replace the default target in the generated dependency file. deps_add_target needs to be called before cpp_read_main_file, otherwise the original object name is added. Contributed by Vincent Vanlaer <vincen...@volkihar.be> PR fortran/47485 gcc/fortran/ChangeLog: * cpp.cc: fix -MT/-MQ adding additional target instead of replacing the default. gcc/testsuite/ChangeLog: * gfortran.dg/dependency_generation_1.f90: New test. Signed-off-by: Vincent Vanlaer <vincen...@volkihar.be>