https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84513
--- Comment #2 from Erik Toussaint <eh.toussaint at gmail dot com> --- Perhaps similar in the sense that in both cases the logic lacks a final check. I don't know anything about the code that handles this, but it appears that the source file gets parsed, and if a module is encountered the name of the .mod file is added to the list of targets (to the left of the colon), and if a use statement is encountered the name of the .mod file is added to the list of dependencies (to the right of the colon). Adding the name of the .mod file for a module that is defined in the current source file to the list of dependencies, though, makes no sense. A final step that checks for this and deletes such .mod files from the list of dependencies if they also exist in the list of targets could resolve this.