From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 33792 invoked by alias); 30 Jan 2020 21:05:27 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 33699 invoked by uid 89); 30 Jan 2020 21:05:26 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=H*MI:local, sk:OFFLOAD, sk:offload, lewis X-HELO: mail-qk1-f177.google.com Received: from mail-qk1-f177.google.com (HELO mail-qk1-f177.google.com) (209.85.222.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 30 Jan 2020 21:05:22 +0000 Received: by mail-qk1-f177.google.com with SMTP id d10so4459825qke.1 for ; Thu, 30 Jan 2020 13:05:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=+WhT/WU08sPIs9l6zUQkL7F83y4R9hLvSq8ytBG0mnw=; b=WgriUislwBIqBevWVqKJw7rvFU8uZfcarvdqvBzFltrtYRbMTZ5aSfYWANa9zxigRK Xh+x1VsfnrYzvRsQOdN5ES5/3A6njSzOjxrZzKEEW/n3YWcGCBJqtcSSudfZw8AnbduL uHQCjyuaPsbdNcM0EVSqe1JLYF7dnUJ57bYOA6l2NkEicBzDWJfy614zJ6ADEBWJvgsV uL1FypH/O/zg5piO/lvaDp7jYFbvlVQDzcb7I7OgfhuKvzz+NTu+0LbSb0armzocWcWu +C6Z/wOLG8Qssb2RqmEaWOlnI9Gpox3zTp0czBHOqn1ghq2PfEr1mZCgB3CgyOnjRplI Z8Sw== Return-Path: Received: from ldh.local (944c6a92.cst.lightpath.net. [148.76.106.146]) by smtp.gmail.com with ESMTPSA id f32sm446045qtk.89.2020.01.30.13.05.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Jan 2020 13:05:19 -0800 (PST) Date: Thu, 30 Jan 2020 23:53:00 -0000 From: Lewis Hyatt To: gcc-patches@gcc.gnu.org Subject: [PATCH] driver: Fix typos in options descriptions Message-ID: <20200130210517.GA24010@ldh.local> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ReaqsoxgOBHFXBhH" Content-Disposition: inline User-Agent: Mutt/1.12.1 (2019-06-15) X-IsSubscribed: yes X-SW-Source: 2020-01/txt/msg02040.txt.bz2 --ReaqsoxgOBHFXBhH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 4078 Hello- While working on adding a new option, I noticed there are some options (e.g. -fdiagnostics-format) that use the two-column form of the option description, but separate the first column with space(s) rather than a tab. This results in the help output looking a bit redundant, since the option name is repeated: $ for f in common optimizers params target warnings; do gcc --help=$f; done | grep -E '^[ ]*(-[^ ]*)[ ]+\1' | sort -Walloc-size-larger-than= -Walloc-size-larger-than= Warn for calls to allocation functions that attempt to allocate objects larger than -Walloc-zero -Walloc-zero Warn for calls to allocation functions that specify zero bytes. -Wno-alloc-size-larger-than -Wno-alloc-size-larger-than Disable Walloc-size-larger-than= warning. Equivalent to Walloc-size-larger- -Wno-alloca-larger-than -Wno-alloca-larger-than Disable Walloca-larger-than= warning. Equivalent to Walloca-larger-than= or larger. -Wno-vla-larger-than -Wno-vla-larger-than Disable Wvla-larger-than= warning. Equivalent to Wvla-larger-than= or larger. Same as -fdebug-prefix-map= -fdebug-prefix-map== Map one directory name to another in debug information. -fdiagnostics-format= -fdiagnostics-format=[text|json] Select output format. -fdisable- -fdisable-[tree|rtl|ipa]-=range1+range2 disables an optimization pass. -fenable- -fenable-[tree|rtl|ipa]-=range1+range2 enables an optimization pass. -ffile-prefix-map= -ffile-prefix-map== Map one directory name to another in compilation result. -finstrument-functions-exclude-file-list= -finstrument-functions-exclude-file-list=filename,... Do not instrument functions listed in files. -finstrument-functions-exclude-function-list= -finstrument-functions-exclude-function-list=name,... Do not instrument listed functions. -foffload-abi= -foffload-abi=[lp64|ilp32] Set the ABI to use in an offload compiler. -foffload= -foffload== Specify offloading targets and options for them. Is this something that would be desirable to change for GCC 10? Attached patch would do so, and the output would become instead: -Walloc-size-larger-than= Warn for calls to allocation functions that attempt to allocate objects larger than the specified number of bytes. -Walloc-zero Warn for calls to allocation functions that specify zero bytes. -Wno-alloc-size-larger-than Disable Walloc-size-larger-than= warning. Equivalent to Walloc-size-larger-than= or larger. Same as -Walloc-size-larger-than=. -Wno-alloca-larger-than Disable Walloca-larger-than= warning. Equivalent to Walloca-larger-than= or larger. Same as -Walloca-larger-than=. -Wno-vla-larger-than Disable Wvla-larger-than= warning. Equivalent to Wvla-larger-than= or larger. Same as -Wvla-larger-than=. -fdebug-prefix-map== Map one directory name to another in debug information. -fdiagnostics-format=[text|json] Select output format. -fdisable-[tree|rtl|ipa]-=range1+range2 Disable an optimization pass. -fenable-[tree|rtl|ipa]-=range1+range2 Enable an optimization pass. -ffile-prefix-map== Map one directory name to another in compilation result. -finstrument-functions-exclude-file-list=filename,... Do not instrument functions listed in files. -finstrument-functions-exclude-function-list=name,... Do not instrument listed functions. -foffload-abi=[lp64|ilp32] Set the ABI to use in an offload compiler. -foffload== Specify offloading targets and options for them. For the most part it is just changing spaces to tabs, although in some cases the two-column form was redundant so I removed the option name from the beginning of the description instead. Bootstrapped and regtested on x86-64 linux also. One test failed because it was explicitly looking for the old output; modified that test too. -Lewis --ReaqsoxgOBHFXBhH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="ChangeLog.txt" Content-length: 579 gcc/ChangeLog: 2020-01-30 Lewis Hyatt * common.opt: Avoid redundancy in the help text. * config/arc/arc.opt: Likewise. * config/cr16/cr16.opt: Likewise. gcc/c-family/ChangeLog: 2020-01-30 Lewis Hyatt * c.opt: Avoid redundancy in the help text. gcc/fortran/ChangeLog: 2020-01-30 Lewis Hyatt * lang.opt: Avoid redundancy in the help text. gcc/testsuite/ChangeLog: 2020-01-30 Lewis Hyatt * gcc.misc-tests/help.exp: Adapt to new output for -Walloc-size-larger-than= option. --ReaqsoxgOBHFXBhH Content-Type: text/x-patch; charset=us-ascii Content-Disposition: attachment; filename="options_help.patch" Content-length: 10114 commit 6d98063c67de48928b48783dc54eca3b4e64a4e1 Author: Lewis Hyatt Date: Thu Jan 30 12:18:13 2020 -0500 driver: Fix redundant descriptions in options diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index 814ed17f7c4..fd760ee9aea 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -309,16 +309,16 @@ Warn on any use of alloca. Walloc-size-larger-than= C ObjC C++ LTO ObjC++ Var(warn_alloc_size_limit) Joined Host_Wide_Int ByteSize Warning Init(HOST_WIDE_INT_MAX) --Walloc-size-larger-than= Warn for calls to allocation functions that +-Walloc-size-larger-than= Warn for calls to allocation functions that attempt to allocate objects larger than the specified number of bytes. Wno-alloc-size-larger-than C ObjC C++ LTO ObjC++ Alias(Walloc-size-larger-than=,18446744073709551615EiB,none) Warning --Wno-alloc-size-larger-than Disable Walloc-size-larger-than= warning. Equivalent to Walloc-size-larger-than= or larger. +Disable Walloc-size-larger-than= warning. Equivalent to Walloc-size-larger-than= or larger. Walloc-zero C ObjC C++ ObjC++ Var(warn_alloc_zero) Warning --Walloc-zero Warn for calls to allocation functions that specify zero bytes. +Warn for calls to allocation functions that specify zero bytes. Walloca-larger-than= C ObjC C++ LTO ObjC++ Var(warn_alloca_limit) Warning Joined Host_Wide_Int ByteSize Init(HOST_WIDE_INT_MAX) @@ -328,7 +328,7 @@ alloca, and on bounded uses of alloca whose bound can be larger than Wno-alloca-larger-than C ObjC C++ LTO ObjC++ Alias(Walloca-larger-than=,18446744073709551615EiB,none) Warning --Wno-alloca-larger-than Disable Walloca-larger-than= warning. Equivalent to Walloca-larger-than= or larger. +Disable Walloca-larger-than= warning. Equivalent to Walloca-larger-than= or larger. Warray-bounds LangEnabledBy(C ObjC C++ LTO ObjC++) @@ -1252,7 +1252,7 @@ larger than bytes. Wno-vla-larger-than C ObjC C++ LTO ObjC++ Alias(Wvla-larger-than=,18446744073709551615EiB,none) Warning --Wno-vla-larger-than Disable Wvla-larger-than= warning. Equivalent to Wvla-larger-than= or larger. +Disable Wvla-larger-than= warning. Equivalent to Wvla-larger-than= or larger. Wvolatile C++ ObjC++ Var(warn_volatile) Warning @@ -1313,7 +1313,7 @@ Enforce class member access control semantics. fada-spec-parent= C ObjC C++ ObjC++ RejectNegative Joined Var(ada_specs_parent) --fada-spec-parent=unit Dump Ada specs as child units of given parent. +-fada-spec-parent=unit Dump Ada specs as child units of given parent. faligned-new C++ ObjC++ Alias(faligned-new=,1,0) @@ -1321,7 +1321,7 @@ Support C++17 allocation of over-aligned types. faligned-new= C++ ObjC++ Joined RejectNegative Var(aligned_new_threshold) UInteger Init(-1) --faligned-new= Use C++17 over-aligned type allocation for alignments greater than N. +-faligned-new= Use C++17 over-aligned type allocation for alignments greater than N. fall-virtual C++ ObjC++ WarnRemoved @@ -1515,7 +1515,7 @@ Permit '$' as an identifier character. fmacro-prefix-map= C ObjC C++ ObjC++ Joined RejectNegative --fmacro-prefix-map== Map one directory name to another in __FILE__, __BASE_FILE__, and __builtin_FILE(). +-fmacro-prefix-map== Map one directory name to another in __FILE__, __BASE_FILE__, and __builtin_FILE(). fdump-ada-spec C ObjC C++ ObjC++ RejectNegative Var(flag_dump_ada_spec) @@ -1530,7 +1530,7 @@ C++ ObjC++ Var(flag_elide_constructors) Init(1) felide-type C++ ObjC++ Var(flag_elide_type) Init(1) --fno-elide-type Do not elide common elements in template comparisons. +Do not elide common elements in template comparisons. fenforce-eh-specs C++ ObjC++ Var(flag_enforce_eh_specs) Init(1) @@ -1778,11 +1778,11 @@ C ObjC C++ ObjC++ JoinedOrMissing RejectNegative UInteger ftrack-macro-expansion= C ObjC C++ ObjC++ JoinedOrMissing RejectNegative UInteger --ftrack-macro-expansion=<0|1|2> Track locations of tokens coming from macro expansion and display them in error messages. +-ftrack-macro-expansion=<0|1|2> Track locations of tokens coming from macro expansion and display them in error messages. fpretty-templates C++ ObjC++ Var(flag_pretty_templates) Init(1) --fno-pretty-templates Do not pretty-print template specializations as the template signature followed by the arguments. +Do not pretty-print template specializations as the template signature followed by the arguments. fprintf-return-value C ObjC C++ ObjC++ LTO Optimization Var(flag_printf_return_value) Init(1) diff --git a/gcc/common.opt b/gcc/common.opt index 5692cd04374..5403c18bfde 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -1196,11 +1196,11 @@ Common RejectNegative Joined Var(common_deferred_options) Defer fdebug-prefix-map= Common Joined RejectNegative Var(common_deferred_options) Defer --fdebug-prefix-map== Map one directory name to another in debug information. +-fdebug-prefix-map== Map one directory name to another in debug information. ffile-prefix-map= Common Joined RejectNegative Var(common_deferred_options) Defer --ffile-prefix-map== Map one directory name to another in compilation result. +-ffile-prefix-map== Map one directory name to another in compilation result. fdebug-types-section Common Report Var(flag_debug_types_section) Init(0) @@ -1311,7 +1311,7 @@ Enum(diagnostic_url_rule) String(auto) Value(DIAGNOSTICS_URL_AUTO) fdiagnostics-format= Common Joined RejectNegative Enum(diagnostics_output_format) --fdiagnostics-format=[text|json] Select output format. +-fdiagnostics-format=[text|json] Select output format. ; Required for these enum values. SourceInclude @@ -1368,11 +1368,11 @@ Set minimum width of left margin of source code when showing source. fdisable- Common Joined RejectNegative Var(common_deferred_options) Defer --fdisable-[tree|rtl|ipa]-=range1+range2 disables an optimization pass. +-fdisable-[tree|rtl|ipa]-=range1+range2 Disable an optimization pass. fenable- Common Joined RejectNegative Var(common_deferred_options) Defer --fenable-[tree|rtl|ipa]-=range1+range2 enables an optimization pass. +-fenable-[tree|rtl|ipa]-=range1+range2 Enable an optimization pass. fdump- Common Joined RejectNegative Var(common_deferred_options) Defer @@ -1755,11 +1755,11 @@ Instrument function entry and exit with profiling calls. finstrument-functions-exclude-function-list= Common RejectNegative Joined --finstrument-functions-exclude-function-list=name,... Do not instrument listed functions. +-finstrument-functions-exclude-function-list=name,... Do not instrument listed functions. finstrument-functions-exclude-file-list= Common RejectNegative Joined --finstrument-functions-exclude-file-list=filename,... Do not instrument functions listed in files. +-finstrument-functions-exclude-file-list=filename,... Do not instrument functions listed in files. fipa-cp Common Report Var(flag_ipa_cp) Optimization @@ -2020,11 +2020,11 @@ Support synchronous non-call exceptions. foffload= Common Driver Joined MissingArgError(options or targets missing after %qs) --foffload== Specify offloading targets and options for them. +-foffload== Specify offloading targets and options for them. foffload-abi= Common Joined RejectNegative Enum(offload_abi) Var(flag_offload_abi) Init(OFFLOAD_ABI_UNSET) --foffload-abi=[lp64|ilp32] Set the ABI to use in an offload compiler. +-foffload-abi=[lp64|ilp32] Set the ABI to use in an offload compiler. Enum Name(offload_abi) Type(enum offload_abi) UnknownError(unknown offload ABI %qs) diff --git a/gcc/config/arc/arc.opt b/gcc/config/arc/arc.opt index 94c6f5403e1..54aab9e2a56 100644 --- a/gcc/config/arc/arc.opt +++ b/gcc/config/arc/arc.opt @@ -59,7 +59,7 @@ Force all calls to be made via a jli instruction. mmpy-option= Target RejectNegative Joined Enum(arc_mpy) Var(arc_mpy_option) Init(DEFAULT_arc_mpy_option) --mmpy-option=MPY Compile ARCv2 code with a multiplier design option. +-mmpy-option=MPY Compile ARCv2 code with a multiplier design option. Enum Name(arc_mpy) Type(int) @@ -251,7 +251,7 @@ Cost to assume for a multiply instruction, with 4 being equal to a normal insn. mtune= Target RejectNegative ToLower Joined Var(arc_tune) Enum(arc_tune_attr) Init(ARC_TUNE_NONE) --mcpu=TUNE Tune code for given ARC variant. +-mtune=TUNE Tune code for given ARC variant. Enum Name(arc_tune_attr) Type(int) diff --git a/gcc/config/cr16/cr16.opt b/gcc/config/cr16/cr16.opt index 0396c8dd8fb..f82c1d633fb 100644 --- a/gcc/config/cr16/cr16.opt +++ b/gcc/config/cr16/cr16.opt @@ -20,7 +20,7 @@ msim Target --msim Use simulator runtime. +Use simulator runtime. mbit-ops Target Report Mask(BIT_OPS) diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt index 59523f74acf..da4b1aa879a 100644 --- a/gcc/fortran/lang.opt +++ b/gcc/fortran/lang.opt @@ -415,7 +415,7 @@ Produce a warning at runtime if a array temporary has been created for a procedu fconvert= Fortran RejectNegative Joined Enum(gfc_convert) Var(flag_convert) Init(GFC_FLAG_CONVERT_NATIVE) --fconvert= The endianness used for unformatted files. +-fconvert= The endianness used for unformatted files. Enum Name(gfc_convert) Type(enum gfc_convert) UnknownError(Unrecognized option to endianness value: %qs) diff --git a/gcc/testsuite/gcc.misc-tests/help.exp b/gcc/testsuite/gcc.misc-tests/help.exp index a9ee892c8f3..bcb62e09b6a 100644 --- a/gcc/testsuite/gcc.misc-tests/help.exp +++ b/gcc/testsuite/gcc.misc-tests/help.exp @@ -115,7 +115,7 @@ check_for_options c "-Q --help=warnings" { # Verify that an option that expects a byte-size argument is shown with # a meaningful byte-size argument as the value. check_for_options c "-Q --help=warnings" { --Walloc-size-larger-than=[ \t]+[1-9][0-9]+ bytes +-Walloc-size-larger-than=[ \t]+[1-9][0-9]+ bytes -Wlarger-than=[^\n\r]+[1-9][0-9]+ bytes } "" "" --ReaqsoxgOBHFXBhH--