]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR preprocessor/22231 (-MG ignores missing headers even with -c)
authorTom Tromey <tromey@redhat.com>
Fri, 9 May 2008 22:17:00 +0000 (22:17 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Fri, 9 May 2008 22:17:00 +0000 (22:17 +0000)
gcc
PR preprocessor/22231:
* c-opts.c (sanitize_cpp_opts): Disallow -MG if compilation is
proceeding.
gcc/testsuite
PR preprocessor/22231:
* gcc.dg/pr22231.c: New file.

From-SVN: r135128

gcc/ChangeLog
gcc/c-opts.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr22231.c [new file with mode: 0644]

index 12105febf46770d7041de6d23554fae56e80e4e1..3d1e78add322839a7a849e1a222623383195fe72 100644 (file)
@@ -1,3 +1,9 @@
+2008-05-09  Tom Tromey  <tromey@redhat.com>
+
+       PR preprocessor/22231:
+       * c-opts.c (sanitize_cpp_opts): Disallow -MG if compilation is
+       proceeding.
+
 2008-05-09  Uros Bizjak  <ubizjak@gmail.com>
 
        PR tree-optimization/36129
index 1413b7f8036bf5b271d9ea109b0f9178a448d68e..eda0f48f9496e2d1434685f4844bc9830c21477f 100644 (file)
@@ -1427,6 +1427,8 @@ sanitize_cpp_opts (void)
       flag_dump_includes = 0;
       flag_no_line_commands = 1;
     }
+  else if (cpp_opts->deps.missing_files)
+    error ("-MG may only be used with -M or -MM");
 
   cpp_opts->unsigned_char = !flag_signed_char;
   cpp_opts->stdc_0_in_system_headers = STDC_0_IN_SYSTEM_HEADERS;
index 531df9fe646dbefdb7ec2cfde9e5899ed56b3437..0195eab05b5bed583925357d1274007777378888 100644 (file)
@@ -1,3 +1,8 @@
+2008-05-09  Tom Tromey  <tromey@redhat.com>
+
+       PR preprocessor/22231:
+       * gcc.dg/pr22231.c: New file.
+
 2008-05-09  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/36187
diff --git a/gcc/testsuite/gcc.dg/pr22231.c b/gcc/testsuite/gcc.dg/pr22231.c
new file mode 100644 (file)
index 0000000..cca27c6
--- /dev/null
@@ -0,0 +1,7 @@
+/* Test case for PR 22231.  -c and -MG are invalid together.  */
+
+/* { dg-do compile } */
+/* { dg-options "-MG -MD -c" } */
+/* { dg-error "may only be used with -M" "" 0 */
+
+int anything;