* [PATCH] Provide proper error message for -flto=abcd.
@ 2019-07-29 13:47 Martin Liška
2019-08-08 21:46 ` Jeff Law
0 siblings, 1 reply; 2+ messages in thread
From: Martin Liška @ 2019-07-29 13:47 UTC (permalink / raw)
To: gcc-patches; +Cc: Jan Hubicka
[-- Attachment #1: Type: text/plain, Size: 693 bytes --]
Hi.
The patch is about proper error message for situations where
user give a wrong argument to -flto option.
Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
Ready to be installed?
Thanks,
Martin
gcc/ChangeLog:
2019-07-29 Martin Liska <mliska@suse.cz>
* opts.c (common_handle_option): Error for an invalid argument
to -flto=.
gcc/testsuite/ChangeLog:
2019-07-29 Martin Liska <mliska@suse.cz>
* gcc.dg/spellcheck-options-21.c: New test.
---
gcc/opts.c | 8 ++++++++
gcc/testsuite/gcc.dg/spellcheck-options-21.c | 3 +++
2 files changed, 11 insertions(+)
create mode 100644 gcc/testsuite/gcc.dg/spellcheck-options-21.c
[-- Attachment #2: 0001-Provide-proper-error-message-for-flto-abcd.patch --]
[-- Type: text/x-patch, Size: 922 bytes --]
diff --git a/gcc/opts.c b/gcc/opts.c
index 296f0f61802..3639edf4cd7 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -2821,6 +2821,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/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 } */
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Provide proper error message for -flto=abcd.
2019-07-29 13:47 [PATCH] Provide proper error message for -flto=abcd Martin Liška
@ 2019-08-08 21:46 ` Jeff Law
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2019-08-08 21:46 UTC (permalink / raw)
To: Martin Liška, gcc-patches; +Cc: Jan Hubicka
On 7/29/19 7:36 AM, Martin Liška wrote:
> Hi.
>
> The patch is about proper error message for situations where
> user give a wrong argument to -flto option.
>
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
>
> Ready to be installed?
> Thanks,
> Martin
>
> gcc/ChangeLog:
>
> 2019-07-29 Martin Liska <mliska@suse.cz>
>
> * opts.c (common_handle_option): Error for an invalid argument
> to -flto=.
>
> gcc/testsuite/ChangeLog:
>
> 2019-07-29 Martin Liska <mliska@suse.cz>
>
> * gcc.dg/spellcheck-options-21.c: New test.
OK, including any minor adjustments to deal with any changes in the
-flto option made since this was originally submitted.
jeff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-08-08 21:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-29 13:47 [PATCH] Provide proper error message for -flto=abcd Martin Liška
2019-08-08 21:46 ` Jeff Law
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).