From: Martin Liska Date: Fri, 9 Aug 2019 07:51:40 +0000 (+0200) Subject: Provide proper error message for -flto=abcd. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=40077d15a87e7fe707b7282ab6f241737d2b3b18;p=gcc.git Provide proper error message for -flto=abcd. 2019-08-09 Martin Liska * opts.c (common_handle_option): Error for an invalid argument to -flto=. 2019-08-09 Martin Liska * gcc.dg/spellcheck-options-21.c: New test. From-SVN: r274231 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 21652c835eb..50a2b8f49f4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-08-09 Martin Liska + + * opts.c (common_handle_option): Error for an invalid argument + to -flto=. + 2019-08-09 Martin Liska * ipa-icf.c (sem_function::merge): Define AUTO_DUMP_SCOPE and diff --git a/gcc/opts.c b/gcc/opts.c index 28142cef044..a0a77893448 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -2822,6 +2822,14 @@ common_handle_option (struct gcc_options *opts, opts->x_flag_lto = value ? "" : NULL; break; + case OPT_flto_: + if (strcmp (arg, "none") != 0 + && strcmp (arg, "jobserver") != 0 + && atoi (arg) == 0) + error_at (loc, + "unrecognized argument to %<-flto=%> option: %qs", arg); + break; + case OPT_w: dc->dc_inhibit_warnings = true; break; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 73022f37b1f..317b7e54e21 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2019-08-09 Martin Liska + + * gcc.dg/spellcheck-options-21.c: New test. + 2019-08-09 Martin Liska * g++.dg/ipa/ipa-icf-2.C: Add -optimized to -fdump-ipa-icf. diff --git a/gcc/testsuite/gcc.dg/spellcheck-options-21.c b/gcc/testsuite/gcc.dg/spellcheck-options-21.c new file mode 100644 index 00000000000..3e0e8a8ebaf --- /dev/null +++ b/gcc/testsuite/gcc.dg/spellcheck-options-21.c @@ -0,0 +1,3 @@ +/* { dg-do compile } */ +/* { dg-options "-flto=sparta" } */ +/* { dg-error "unrecognized argument to '-flto=' option: 'sparta'" "" { target *-*-* } 0 } */