This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC][PATCH] Postpone print of --help=* option.
- From: Martin Liška <mliska at suse dot cz>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Ulrich Drepper <drepper at gmail dot com>
- Date: Thu, 2 May 2019 12:51:05 +0200
- Subject: Re: [RFC][PATCH] Postpone print of --help=* option.
- References: <89537b9e-fac3-40eb-145a-3390d90050bf@suse.cz> <20190502103059.GQ2706@tucnak>
On 5/2/19 12:30 PM, Jakub Jelinek wrote:
> On Mon, Apr 01, 2019 at 02:11:17PM +0200, Martin Liška wrote:
>> 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.
>
> As reported by Ulrich Drepper on IRC, this broke
> --enable-as-accelerator-for=... build, tree-streamer-in.c calls
> finish_options too and that caller has not been adjusted.
You are right, it's guarded in #ifdef ACCEL_COMPILER
so I haven't seen the compilation error.
>
> Any reason why you've called print_help from finish_options rather than
> decode_options after it calls finish_options?
Yes, I need that as I need option propagation, as described in:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89885#c0
>
> Or should tree-streamer-in.c pass CL_LTO as the lang_mask, or say CL_DRIVER
> so that print_help does nothing in that case?
Yes, that would fix it. Can you please provide a patch that he can test?
Thanks,
Martin
>
> Jakub
>