From: Tom Tromey Date: Fri, 9 May 2008 22:17:00 +0000 (+0000) Subject: re PR preprocessor/22231 (-MG ignores missing headers even with -c) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4822e563a0bb9ba66af37440964d8d1ad403710f;p=gcc.git re PR preprocessor/22231 (-MG ignores missing headers even with -c) 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 12105febf46..3d1e78add32 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-05-09 Tom Tromey + + PR preprocessor/22231: + * c-opts.c (sanitize_cpp_opts): Disallow -MG if compilation is + proceeding. + 2008-05-09 Uros Bizjak PR tree-optimization/36129 diff --git a/gcc/c-opts.c b/gcc/c-opts.c index 1413b7f8036..eda0f48f949 100644 --- a/gcc/c-opts.c +++ b/gcc/c-opts.c @@ -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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 531df9fe646..0195eab05b5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-05-09 Tom Tromey + + PR preprocessor/22231: + * gcc.dg/pr22231.c: New file. + 2008-05-09 Richard Guenther PR tree-optimization/36187 diff --git a/gcc/testsuite/gcc.dg/pr22231.c b/gcc/testsuite/gcc.dg/pr22231.c new file mode 100644 index 00000000000..cca27c66f5b --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr22231.c @@ -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;