public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin Liška" <mliska@suse.cz>
To: Jeff Law <law@redhat.com>, gcc-patches@gcc.gnu.org
Subject: Re: [RFC][PATCH] Postpone print of --help=* option.
Date: Thu, 02 May 2019 08:15:00 -0000	[thread overview]
Message-ID: <7ba27916-cffb-5eb8-4585-69a30cfa4033@suse.cz> (raw)
In-Reply-To: <8633a722-e8c4-5965-810e-4b0f33c27187@redhat.com>

On 4/30/19 6:18 PM, Jeff Law wrote:
> On 4/1/19 6:11 AM, Martin Liška wrote:
>> Hi.
>>
>> Last week I was curious which warnings are disabled by default on top
>> of -Wall and -Wextra. Thus I used --help=warning and noticed some discrepancy
>> in between documentation and output of the --help option.
>>
>> I created PR89885 where I explained that OPT__help_ option handling happens
>> early. That's why LangEnabledBy are not reflected and similarly target overrides
>> don't take place.
>>
>> I'm attaching diff for --help=warning for C++ and -Ofast.
>>
>> Thoughts?
>>
>> gcc/ChangeLog:
>>
>> 2019-04-01  Martin Liska  <mliska@suse.cz>
>>
>> 	* gcc.c (process_command): Add dummy file only
>> 	if n_infiles == 0.
>> 	* opts-global.c (decode_options): Pass lang_mask.
>> 	* opts.c (print_help): New function.
>> 	(finish_options): Print --help if help_option_argument
>> 	is set.
>> 	(common_handle_option): Factor out content of OPT__help_
>> 	into print_help.
>> 	* opts.h (finish_options): Add new argument.
>> ---
>>  gcc/gcc.c         |   3 +-
>>  gcc/opts-global.c |   2 +-
>>  gcc/opts.c        | 267 ++++++++++++++++++++++++----------------------
>>  gcc/opts.h        |   3 +-
>>  4 files changed, 146 insertions(+), 129 deletions(-)
>>
>>
>>
>> 0001-Postpone-print-of-help-option.patch
>>
>> diff --git a/gcc/gcc.c b/gcc/gcc.c
>> index 4f57765b012..7ce1cae28a7 100644
>> --- a/gcc/gcc.c
>> +++ b/gcc/gcc.c
>> @@ -4751,7 +4751,8 @@ process_command (unsigned int decoded_options_count,
>>      }
>>  
>>    /* Ensure we only invoke each subprocess once.  */
>> -  if (print_subprocess_help || print_help_list || print_version)
>> +  if (n_infiles == 0
>> +      && (print_subprocess_help || print_help_list || print_version))
>>      {
>>        n_infiles = 0;
> The assignment to n_infiles is redundant after your change.  I suspect
> the optimizers will catch this, so if you want to keep it for clarity
> that's fine with me.
> 
> OK for the trunk.  Your call whether or not to remove the redundant
> assignment.

Thank you for review. I've removed the redundancy assignment before
commit.

Martin

> 
> jeff
> 

  reply	other threads:[~2019-05-02  8:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-01 12:11 Martin Liška
2019-04-30 16:39 ` Jeff Law
2019-05-02  8:15   ` Martin Liška [this message]
2019-05-02 10:31 ` Jakub Jelinek
2019-05-02 10:51   ` Martin Liška
2019-05-02 11:04     ` Jakub Jelinek
2019-05-02 11:13       ` Martin Liška
2019-05-03  7:18       ` [PATCH] Fix build with offloading (Re: [RFC][PATCH] Postpone print of --help=* option.) Jakub Jelinek
2019-05-03  7:20         ` Richard Biener
2019-05-03 11:33 ` [RFC][PATCH] Postpone print of --help=* option Szabolcs Nagy
2019-05-03 11:36   ` Martin Liška

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7ba27916-cffb-5eb8-4585-69a30cfa4033@suse.cz \
    --to=mliska@suse.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).