This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C] Patch: fix PR 22231
Hi Tom,
It doesn't work on Linux/ia32:
Executing on host: /export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc/build-x86_64-linux/gcc/
/net/gnu-13/export/gnu/src/gcc/gcc/gcc/testsuite/gcc.dg/pr22231.c
-MG -MD -c -fno-show-column -S -m32 -o pr22231.s (timeout = 300)
cc1: error: -MG may only be used with -M or -MM^M
compiler exited with status 1
output is:
cc1: error: -MG may only be used with -M or -MM^M
FAIL: gcc.dg/pr22231.c (test for excess errors)
Excess errors:
cc1: error: -MG may only be used with -M or -MM
H.J.
On Fri, May 9, 2008 at 3:13 PM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Joseph" == Joseph S Myers <joseph@codesourcery.com> writes:
>
>>> PR preprocessor/22231:
>>> * c-opts.c (sanitize_cpp_opts): Disallow -MG if compilation is
>>> proceeding.
>
> Joseph> OK if you add a testcase for this error.
>
> Oops, my apologies. I've appended the patch I am checking in.
>
> Tom
>
> ChangeLog:
> 2008-05-09 Tom Tromey <tromey@redhat.com>
>
> PR preprocessor/22231:
> * c-opts.c (sanitize_cpp_opts): Disallow -MG if compilation is
> proceeding.
>
> testsuite/ChangeLog:
> 2008-05-09 Tom Tromey <tromey@redhat.com>
>
> PR preprocessor/22231:
> * gcc.dg/pr22231.c: New file.
>
> Index: testsuite/gcc.dg/pr22231.c
> ===================================================================
> --- testsuite/gcc.dg/pr22231.c (revision 0)
> +++ testsuite/gcc.dg/pr22231.c (revision 0)
> @@ -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;
> Index: c-opts.c
> ===================================================================
> --- c-opts.c (revision 134988)
> +++ c-opts.c (working copy)
> @@ -1427,6 +1427,8 @@
> 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;
>