This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix DEPENDENCIES_OUTPUT (regression from 3.4.x)


Hi!

DEPENDENCIES_OUTPUT="depfile foo" gcc4 -v -c test.c
results in:
test.o: test.c
while it emitted:
foo: test.c
in GCC 3.4.x and earlier.
If -MT bar is added, both gcc4 and gcc 3.4.x emit:
bar foo: test.c

This bug was introduced in 2004-06-05 patch that added
  if (!deps_seen)
    return;
to the beginning of handle_deferred_opts.
check_deps_environment_vars doesn't set deps_seen, so nothing
would happen if no -MT/-MQ/-MF/-MG/-MP options are present.
The only other user of deps_seen is 
  if (deps_seen && cpp_opts->deps.style == DEPS_NONE)
    error ("to generate dependencies you must specify either -M or -MM");
in sanitize_cpp_opts, but if check_deps_environment_vars
found a deps env variable, cpp_opts->deps.style
is certainly not DEPS_NONE.

Ok to commit?

2004-11-28  Jakub Jelinek  <jakub@redhat.com>

	* c-opts.c (check_deps_environment_vars): If spec != NULL, set
	deps_seen.

--- gcc/c-opts.c.jj	2004-11-24 22:01:35.000000000 +0100
+++ gcc/c-opts.c	2004-11-28 18:50:11.000000000 +0100
@@ -1178,6 +1178,7 @@ check_deps_environment_vars (void)
 	deps_file = spec;
 
       deps_append = 1;
+      deps_seen = true;
     }
 }
 

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]