aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-09-01 16:45:33 +0000
committerJeff Law <law@gcc.gnu.org>2017-09-01 10:45:33 -0600
commitde7c2c6a2479de0002f6a07002b6bca4a3a73015 (patch)
treee4487f80594aa0fb77727cf4491eb335505fca01 /gcc/c-family
parentbeb8b5c154e57f5c2e3e6f372c2bae9a10f619b4 (diff)
downloadgcc-de7c2c6a2479de0002f6a07002b6bca4a3a73015.zip
gcc-de7c2c6a2479de0002f6a07002b6bca4a3a73015.tar.gz
gcc-de7c2c6a2479de0002f6a07002b6bca4a3a73015.tar.bz2
c-opts.c (c_common_finish): Write dependency information even if there are errors.
* c-opts.c (c_common_finish): Write dependency information even if there are errors. From-SVN: r251605
Diffstat (limited to 'gcc/c-family')
-rw-r--r--gcc/c-family/ChangeLog5
-rw-r--r--gcc/c-family/c-opts.c7
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index e1a051f..33cb187 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,8 @@
+2017-09-01 Boris Kolpackov <boris@codesynthesis.com>
+
+ * c-opts.c (c_common_finish): Write dependency information even if
+ there are errors.
+
2017-09-01 Jakub Jelinek <jakub@redhat.com>
PR c/81887
diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
index 0b13a18..9e7f0a3 100644
--- a/gcc/c-family/c-opts.c
+++ b/gcc/c-family/c-opts.c
@@ -1145,8 +1145,11 @@ c_common_finish (void)
{
FILE *deps_stream = NULL;
- /* Don't write the deps file if there are errors. */
- if (cpp_opts->deps.style != DEPS_NONE && !seen_error ())
+ /* Note that we write the dependencies even if there are errors. This is
+ useful for handling outdated generated headers that now trigger errors
+ (for example, with #error) which would be resolved by re-generating
+ them. In a sense, this complements -MG. */
+ if (cpp_opts->deps.style != DEPS_NONE)
{
/* If -M or -MM was seen without -MF, default output to the
output stream. */