------- Comment #6 from mjuric at astro dot princeton dot edu 2006-07-25 15:22 ------- Created an attachment (id=11935) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11935&action=view) Proposed fix for improper dependency tracking with PCHs
This short patch addresses the issue of precompiled header dependencies not being recorded during -MD pass. The problem appeared because deps_add_dep() was never called from _cpp_stack_file, as all of .gch handling is done in should_stack_file(). The patch fixes it by calling deps_add_dep() in should_stack_file(), if the file under consideration is a precompiled header, and if restoration of dependencies from .gch has not been requested (restore_pch_deps == false). Applies to HEAD as well as 4.1.1. PS: This revealed a separate issue with counterintuitive behavior of restore_pch_deps == true (no dependencies shown), which I'll submit as a separate bug and proposed patch. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14933