[Bug driver/83193] Help for invalid -march= options from cc1 omits -march=native on x86-64, arm. aarch64, output also inconsistent
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83193 Richard Biener changed: What|Removed |Added Target Milestone|9.5 |---
[Bug driver/83193] Help for invalid -march= options from cc1 omits -march=native on x86-64, arm. aarch64, output also inconsistent
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83193 Richard Biener changed: What|Removed |Added Target Milestone|9.4 |9.5 --- Comment #23 from Richard Biener --- GCC 9.4 is being released, retargeting bugs to GCC 9.5.
[Bug driver/83193] Help for invalid -march= options from cc1 omits -march=native on x86-64, arm. aarch64, output also inconsistent
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83193 Jakub Jelinek changed: What|Removed |Added Target Milestone|9.3 |9.4 --- Comment #22 from Jakub Jelinek --- GCC 9.3.0 has been released, adjusting target milestone.
[Bug driver/83193] Help for invalid -march= options from cc1 omits -march=native on x86-64, arm. aarch64, output also inconsistent
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83193 Jakub Jelinek changed: What|Removed |Added Target Milestone|9.2 |9.3 --- Comment #21 from Jakub Jelinek --- GCC 9.2 has been released.
[Bug driver/83193] Help for invalid -march= options from cc1 omits -march=native on x86-64, arm. aarch64, output also inconsistent
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83193 Jakub Jelinek changed: What|Removed |Added Target Milestone|9.0 |9.2 --- Comment #20 from Jakub Jelinek --- GCC 9.1 has been released.
[Bug driver/83193] Help for invalid -march= options from cc1 omits -march=native on x86-64, arm. aarch64, output also inconsistent
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83193 Martin Liška changed: What|Removed |Added Status|ASSIGNED|NEW Assignee|marxin at gcc dot gnu.org |unassigned at gcc dot gnu.org --- Comment #19 from Martin Liška --- The only missing pieces are 2c) and 3b). Which should leverage the new target hook targetm_common.get_valid_option_values and provide list of possible values. I'm leaving that to ARM and aarch64 folks.
[Bug driver/83193] Help for invalid -march= options from cc1 omits -march=native on x86-64, arm. aarch64, output also inconsistent
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83193 --- Comment #18 from Martin Liška --- Author: marxin Date: Wed Oct 31 14:46:17 2018 New Revision: 265686 URL: https://gcc.gnu.org/viewcvs?rev=265686&root=gcc&view=rev Log: Provide extension hint for aarch64 target (PR driver/83193). 2018-10-31 Martin Liska PR driver/83193 * common/config/aarch64/aarch64-common.c (aarch64_parse_extension): Add new argument invalid_extension. (aarch64_get_all_extension_candidates): New function. (aarch64_rewrite_selected_cpu): Add NULL to function call. * config/aarch64/aarch64-protos.h (aarch64_parse_extension): Add new argument. (aarch64_get_all_extension_candidates): New function. * config/aarch64/aarch64.c (aarch64_parse_arch): Add new argument invalid_extension. (aarch64_parse_cpu): Likewise. (aarch64_print_hint_for_extensions): New function. (aarch64_validate_mcpu): Provide hint about invalid extension. (aarch64_validate_march): Likewise. (aarch64_handle_attr_arch): Pass new argument. (aarch64_handle_attr_cpu): Provide hint about invalid extension. (aarch64_handle_attr_isa_flags): Likewise. 2018-10-31 Martin Liska PR driver/83193 * gcc.target/aarch64/spellcheck_7.c: New test. * gcc.target/aarch64/spellcheck_8.c: New test. * gcc.target/aarch64/spellcheck_9.c: New test. Added: trunk/gcc/testsuite/gcc.target/aarch64/spellcheck_7.c trunk/gcc/testsuite/gcc.target/aarch64/spellcheck_8.c trunk/gcc/testsuite/gcc.target/aarch64/spellcheck_9.c Modified: trunk/gcc/ChangeLog trunk/gcc/common/config/aarch64/aarch64-common.c trunk/gcc/config/aarch64/aarch64-protos.h trunk/gcc/config/aarch64/aarch64.c trunk/gcc/testsuite/ChangeLog
[Bug driver/83193] Help for invalid -march= options from cc1 omits -march=native on x86-64, arm. aarch64, output also inconsistent
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83193 --- Comment #17 from Martin Liška --- Author: marxin Date: Mon Sep 3 08:16:27 2018 New Revision: 264052 URL: https://gcc.gnu.org/viewcvs?rev=264052&root=gcc&view=rev Log: Come up with TARGET_GET_VALID_OPTION_VALUES option hook (PR driver/83193). 2018-09-03 Martin Liska PR driver/83193 * common/common-target.def: Add TARGET_GET_VALID_OPTION_VALUES. * common/common-targhooks.c (default_get_valid_option_values): New function. * common/common-targhooks.h (default_get_valid_option_values): Likewise. * common/config/i386/i386-common.c: Move processor_target_table from i386.c. (ix86_get_valid_option_values): New function. (TARGET_GET_VALID_OPTION_VALUES): New macro. * config/i386/i386.c (struct ptt): Move to i386-common.c. (PTA_*): Move all defined masks into i386-common.c. (ix86_function_specific_restore): Use new processor_cost_table. * config/i386/i386.h (struct ptt): Moved from i386.c. (struct pta): Likewise. * doc/tm.texi: Document new TARGET_GET_VALID_OPTION_VALUES. * doc/tm.texi.in: Likewise. * opt-suggestions.c (option_proposer::suggest_option): Pass prefix to build_option_suggestions. (option_proposer::get_completions): Likewise. (option_proposer::build_option_suggestions): Use the new target hook. * opts.c (struct option_help_tuple): New struct. (print_filtered_help): Use the new target hook. 2018-09-03 Martin Liska PR driver/83193 * gcc.dg/completion-4.c: New test. Added: trunk/gcc/testsuite/gcc.dg/completion-4.c Modified: trunk/gcc/ChangeLog trunk/gcc/common/common-target.def trunk/gcc/common/common-targhooks.c trunk/gcc/common/common-targhooks.h trunk/gcc/common/config/i386/i386-common.c trunk/gcc/config/i386/i386.c trunk/gcc/config/i386/i386.h trunk/gcc/doc/tm.texi trunk/gcc/doc/tm.texi.in trunk/gcc/opt-suggestions.c trunk/gcc/opt-suggestions.h trunk/gcc/opts.c trunk/gcc/testsuite/ChangeLog
[Bug driver/83193] Help for invalid -march= options from cc1 omits -march=native on x86-64, arm. aarch64, output also inconsistent
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83193 --- Comment #16 from Martin Liška --- Author: marxin Date: Mon Aug 27 08:01:14 2018 New Revision: 263870 URL: https://gcc.gnu.org/viewcvs?rev=263870&root=gcc&view=rev Log: Print default options selection for -march,-mcpu and -mtune for aarch64 (PR driver/83193). 2018-08-27 Martin Liska PR driver/83193 * config/aarch64/aarch64.c (aarch64_override_options_internal): Set default values for x_aarch64_*_string strings. * config/aarch64/aarch64.opt: Remove --{march,mcpu,mtune}== prefix. For -mabi do not print '=ABI' in help and use format for -msve-vector-bits and -moverride options. Modified: trunk/gcc/ChangeLog trunk/gcc/config/aarch64/aarch64.c trunk/gcc/config/aarch64/aarch64.opt
[Bug driver/83193] Help for invalid -march= options from cc1 omits -march=native on x86-64, arm. aarch64, output also inconsistent
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83193 Martin Liška changed: What|Removed |Added Target Milestone|8.0 |9.0
[Bug driver/83193] Help for invalid -march= options from cc1 omits -march=native on x86-64, arm. aarch64, output also inconsistent
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83193 --- Comment #15 from ktkachov at gcc dot gnu.org --- Author: ktkachov Date: Fri Mar 9 15:42:10 2018 New Revision: 258389 URL: https://gcc.gnu.org/viewcvs?rev=258389&root=gcc&view=rev Log: [arm] PR target/83193: Do not print arch/cpu hints twice on invalid -march/-mcpu Currently when handling an invalid -march or -mcpu option on a toolchain without an explicit --with-mode configuration and compiling without an explicit -mthumb or -marm the arm specs end up calling arm_target_thumb_only to determine the "thumbness" of the target, which involves parsing the architecture or cpu name. But the functions doing that parsing also emit error messages and hints on invalid arguments. Later when we parse the architecture or cpu string to as part of the canonicalisation process (arm_canon_arch_option) we end up emitting the errors again. The solution in this patch is to silence the errors during the arm_target_thumb_only processing so that they are not emitted twice. arm_canon_arch_option is guaranteed to run as well, so it can emit the errors and hints that it needs. Bootstrapped and tested on arm-none-linux-gnueabihf. Checked that we emit the arch/cpu hints for invalid -march/-mcpu options only once when no "thumbness" options were specified during configuration or invocation. PR target/83193 * common/config/arm/arm-common.c (arm_parse_arch_option_name): Accept complain bool parameter. Only emit errors if it is true. (arm_parse_cpu_option_name): Likewise. (arm_target_thumb_only): Adjust callers of the above. * config/arm/arm-protos.h (arm_parse_cpu_option_name): Adjust prototype to take a default true bool parameter. (arm_parse_arch_option_name): Likewise. Modified: trunk/gcc/ChangeLog trunk/gcc/common/config/arm/arm-common.c trunk/gcc/config/arm/arm-protos.h
[Bug driver/83193] Help for invalid -march= options from cc1 omits -march=native on x86-64, arm. aarch64, output also inconsistent
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83193 ktkachov at gcc dot gnu.org changed: What|Removed |Added CC||ktkachov at gcc dot gnu.org --- Comment #14 from ktkachov at gcc dot gnu.org --- I'm testing a patch for issue 2b) from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83193#c6 . Thanks for Andrew for the report and thanks Martin for the analysis!
[Bug driver/83193] Help for invalid -march= options from cc1 omits -march=native on x86-64, arm. aarch64, output also inconsistent
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83193 --- Comment #13 from Martin Liška --- Author: marxin Date: Thu Feb 22 12:16:58 2018 New Revision: 257900 URL: https://gcc.gnu.org/viewcvs?rev=257900&root=gcc&view=rev Log: Add "native" as a valid option value for -mcpu/-mtune= on arm (PR driver/83193). 2018-02-22 Martin Liska PR driver/83193 * common/config/arm/arm-common.c (arm_print_hint_for_cpu_option): Add "native" as a possible value. Modified: trunk/gcc/ChangeLog trunk/gcc/common/config/arm/arm-common.c
[Bug driver/83193] Help for invalid -march= options from cc1 omits -march=native on x86-64, arm. aarch64, output also inconsistent
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83193 --- Comment #12 from Martin Liška --- Author: marxin Date: Thu Feb 22 08:50:41 2018 New Revision: 257893 URL: https://gcc.gnu.org/viewcvs?rev=257893&root=gcc&view=rev Log: Add "native" as a valid option value for -march= on i386 (PR driver/83193). 2018-02-22 Martin Liska PR driver/83193 * config/i386/i386.c (ix86_option_override_internal): Add "native" as a possible value for -march and -mtune. Modified: trunk/gcc/ChangeLog trunk/gcc/config/i386/i386.c
[Bug driver/83193] Help for invalid -march= options from cc1 omits -march=native on x86-64, arm. aarch64, output also inconsistent
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83193 --- Comment #11 from Martin Liška --- Author: marxin Date: Wed Feb 21 14:05:45 2018 New Revision: 257874 URL: https://gcc.gnu.org/viewcvs?rev=257874&root=gcc&view=rev Log: Add "native" as a valid option value for -march= on aarch64 (PR driver/83193). 2018-02-21 Martin Liska PR driver/83193 * config/aarch64/aarch64.c (aarch64_print_hint_for_core_or_arch): Add "native" as a possible value. * config/aarch64/aarch64.h (HAVE_LOCAL_CPU_DETECT): Define the macro when native cpu detection is available. Modified: trunk/gcc/ChangeLog trunk/gcc/config/aarch64/aarch64.c trunk/gcc/config/aarch64/aarch64.h
[Bug driver/83193] Help for invalid -march= options from cc1 omits -march=native on x86-64, arm. aarch64, output also inconsistent
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83193 --- Comment #10 from Martin Liška --- Author: marxin Date: Wed Feb 21 14:05:17 2018 New Revision: 257873 URL: https://gcc.gnu.org/viewcvs?rev=257873&root=gcc&view=rev Log: Add "native" as a valid option value for -march= on arm (PR driver/83193). 2018-02-21 Martin Liska PR driver/83193 * common/config/arm/arm-common.c (arm_print_hint_for_arch_option): Add "native" as a possible value. * config/arm/arm.h (HAVE_LOCAL_CPU_DETECT): Define the macro when native cpu detection is available. Modified: trunk/gcc/ChangeLog trunk/gcc/common/config/arm/arm-common.c trunk/gcc/config/arm/arm.h
[Bug driver/83193] Help for invalid -march= options from cc1 omits -march=native on x86-64, arm. aarch64, output also inconsistent
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83193 --- Comment #8 from Martin Liška --- Created attachment 43469 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43469&action=edit 3e) patch candidate
[Bug driver/83193] Help for invalid -march= options from cc1 omits -march=native on x86-64, arm. aarch64, output also inconsistent
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83193 --- Comment #9 from Martin Liška --- Created attachment 43470 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43470&action=edit 3c) patch candidate
[Bug driver/83193] Help for invalid -march= options from cc1 omits -march=native on x86-64, arm. aarch64, output also inconsistent
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83193 --- Comment #7 from Martin Liška --- Created attachment 43468 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43468&action=edit 2c) patch candidate
[Bug driver/83193] Help for invalid -march= options from cc1 omits -march=native on x86-64, arm. aarch64, output also inconsistent
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83193 Martin Liška changed: What|Removed |Added CC||jgreenhalgh at gcc dot gnu.org, ||kyrylo.tkachov at arm dot com, ||marcus.shawcroft at arm dot com, ||ramana.radhakrishnan at arm dot co ||m, richard.earnshaw at arm dot com --- Comment #6 from Martin Liška --- So thank you Andrew for spotting quite many issue. Let me make a summary which we can then fix: 1) x86_64 1a) missing 'native' as a possible value - I'll prepare patch for that - hope it can be accepted in GCC 8 1b) Missing list of possible values in --help=target: that's caused by fact that possible values are not an option enum and it's defined in i386.c. Can be done in GCC 9. 2) ARM 2a) missing 'native' as a possible value - I'll prepare patch for that - hope it can be accepted in GCC 8 2b) error info is displayed twice: Breakpoint 1, inform (location=0, gmsgid=0x4f3893 "valid arguments are: %s") at ../../gcc/diagnostic.c:1158 1158 va_start (ap, gmsgid); (gdb) bt #0 inform (location=0, gmsgid=0x4f3893 "valid arguments are: %s") at ../../gcc/diagnostic.c:1158 #1 0x00419b9c in arm_print_hint_for_arch_option (target=0x7a75c0 "sparta", list=0x4f2780 ) at ../../gcc/common/config/arm/arm-common.c:362 #2 0x00419c90 in arm_parse_arch_option_name (list=0x4f0920 , optname=0x4df5a8 "-march", target=0x7a75c0 "sparta") at ../../gcc/common/config/arm/arm-common.c:387 #3 0x004198bb in arm_target_thumb_only (argc=0, argv=0x7accd8) at ../../gcc/common/config/arm/arm-common.c:282 #4 0x0040dd45 in eval_spec_function (func=0x7acb30 "target_mode_check", args=0x7acc90 "%{march=*:arch %*;mcpu=*:cpu %*;:}") at ../../gcc/gcc.c:6080 #5 0x0040dfd8 in handle_spec_function (p=0x7acc87 "", retval_nonnull=0x0) at ../../gcc/gcc.c:6157 #6 0x0040d5b0 in do_spec_1 (spec=0x7acc50 "%:target_mode_check(%{march=*:arch %*;mcpu=*:cpu %*;:})", inswitch=0, soft_matched_part=0x0) at ../../gcc/gcc.c:5862 #7 0x0040ec94 in process_brace_body (p=0x7acc41 "}", atom=0x7acc03 "mthumb:%:target_mode_check(%{march=*:arch %*;mcpu=*:cpu %*;:})}", end_atom=0x7acc09 ":%:target_mode_check(%{march=*:arch %*;mcpu=*:cpu %*;:})}", starred=0, matched=1) at ../../gcc/gcc.c:6525 #8 0x0040ea9b in handle_braces (p=0x7acc09 ":%:target_mode_check(%{march=*:arch %*;mcpu=*:cpu %*;:})}") at ../../gcc/gcc.c:6432 #9 0x0040d586 in do_spec_1 (spec=0x7acc00 "%{!mthumb:%:target_mode_check(%{march=*:arch %*;mcpu=*:cpu %*;:})}", inswitch=0, soft_matched_part=0x0) at ../../gcc/gcc.c:5856 #10 0x0040ec94 in process_brace_body (p=0x4daa5b "}", atom=0x4daa14 "marm:%{!mthumb:%:target_mode_check(%{march=*:arch %*;mcpu=*:cpu %*;:})}}", end_atom=0x4daa18 ":%{!mthumb:%:target_mode_check(%{march=*:arch %*;mcpu=*:cpu %*;:})}}", starred=0, matched=1) at ../../gcc/gcc.c:6525 #11 0x0040ea9b in handle_braces (p=0x4daa18 ":%{!mthumb:%:target_mode_check(%{march=*:arch %*;mcpu=*:cpu %*;:})}}") at ../../gcc/gcc.c:6432 #12 0x0040d586 in do_spec_1 (spec=0x4daa10 " %{!marm:%{!mthumb:%:target_mode_check(%{march=*:arch %*;mcpu=*:cpu %*;:})}}", inswitch=0, soft_matched_part=0x0) at ../../gcc/gcc.c:5856 #13 0x0040a9c5 in do_spec_2 (spec=0x4daa10 " %{!marm:%{!mthumb:%:target_mode_check(%{march=*:arch %*;mcpu=*:cpu %*;:})}}") at ../../gcc/gcc.c:4894 #14 0x0040abc8 in do_self_spec (spec=0x4daa10 " %{!marm:%{!mthumb:%:target_mode_check(%{march=*:arch %*;mcpu=*:cpu %*;:})}}") at ../../gcc/gcc.c:4959 #15 0x00411a2c in driver::set_up_specs (this=0x7fffdaf0) at ../../gcc/gcc.c:7533 #16 0x004109a7 in driver::main (this=0x7fffdaf0, argc=4, argv=0x7fffdc08) at ../../gcc/gcc.c:7297 #17 0x00418e38 in main (argc=4, argv=0x7fffdc08) at ../../gcc/gcc-main.c:46 and Breakpoint 1, inform (location=0, gmsgid=0x4f3893 "valid arguments are: %s") at ../../gcc/diagnostic.c:1158 1158 va_start (ap, gmsgid); (gdb) bt #0 inform (location=0, gmsgid=0x4f3893 "valid arguments are: %s") at ../../gcc/diagnostic.c:1158 #1 0x00419b9c in arm_print_hint_for_arch_option (target=0x7a7600 "sparta", list=0x4f2780 ) at ../../gcc/common/config/arm/arm-common.c:362 #2 0x00419c90 in arm_parse_arch_option_name (list=0x4f0920 , optname=0x4df5a8 "-march", target=0x7a7600 "sparta") at ../../gcc/common/config/arm/arm-common.c:387 #3 0x0041a38b in arm_canon_arch_option (argc=0, argv=0x7accd8) at ../../gcc/common/config/arm/arm-common.c:620 #4 0x0040dd45 in eval_spec_function (func=0x7acb30 "canon_arch", args=0x7a39c0 "%{mcpu=*: cpu %*}", ' ' , "%{march=*: arch %*}", ' ' , "%{mfpu=*: fpu %
[Bug driver/83193] Help for invalid -march= options from cc1 omits -march=native on x86-64, arm. aarch64, output also inconsistent
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83193 --- Comment #5 from Martin Liška --- Author: marxin Date: Tue Feb 20 12:18:07 2018 New Revision: 257844 URL: https://gcc.gnu.org/viewcvs?rev=257844&root=gcc&view=rev Log: Fix missing info for -march and -mtune wrong values on aarch64 (PR driver/83193). 2018-02-20 Martin Liska PR driver/83193 * config/aarch64/aarch64.c (aarch64_print_hint_for_core_or_arch): Print possible values if we don't have a hint. Modified: trunk/gcc/ChangeLog trunk/gcc/config/aarch64/aarch64.c
[Bug driver/83193] Help for invalid -march= options from cc1 omits -march=native on x86-64, arm. aarch64, output also inconsistent
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83193 --- Comment #4 from Andrew Roberts --- Correct, it does not show native in the list of valid options presented to the user.
[Bug driver/83193] Help for invalid -march= options from cc1 omits -march=native on x86-64, arm. aarch64, output also inconsistent
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83193 Martin Liška changed: What|Removed |Added Status|NEW |ASSIGNED Target Milestone|--- |8.0 --- Comment #3 from Martin Liška --- Confirmed, by '-march=native no longer documented in cc1 help message and the help output' you mean adding 'native' as one possible option value for -march and -mtune. Am I right?
[Bug driver/83193] Help for invalid -march= options from cc1 omits -march=native on x86-64, arm. aarch64, output also inconsistent
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83193 Martin Liška changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2017-12-20 CC||marxin at gcc dot gnu.org Assignee|unassigned at gcc dot gnu.org |marxin at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #2 from Martin Liška --- Let me take a look.
[Bug driver/83193] Help for invalid -march= options from cc1 omits -march=native on x86-64, arm. aarch64, output also inconsistent
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83193 --- Comment #1 from Andrew Roberts --- The same comments also apply to the -mcpu and -mtune options as well. Double output on arm for -mcpu, and missing help for native. also: gcc -Q --help=target used to document the allowable -mcpu/-mtune options, but now only documents the allowable -mfpu/-mfpmath= options (across ARM, AARCH64 and X86-64). This was really helpful. And on aarch64 the -Q --help-target option doesn't properly display -march, -mcpu -mtune, it displays -march=ARCH, -mcpu=CPU, -mtune=CPU, rather than -march=, -mcpu=, -mtune= as other systems do. AARCH64 /usr/local/gcc/bin/gcc -Q --help=target The following options are target specific: ... -march=ARCH armv8-a ... -mcpu=CPU ... -mtune=CPU ARM /usr/local/gcc/bin/gcc -Q --help=target The following options are target specific: ... -march= armv7-a+fp ... -mcpu= ... -mtune= X86-64 /usr/local/gcc/bin/gcc -Q --help=target The following options are target specific: ... -march= x86-64 ... -mcpu= ... -mtune= generic Sorry to be so pedantic.