Even though -march=nocona enables SSE2 and SSE3 extensions, gcc -Q --help=target does not list them as enabled. This may be confusing to the user (see http://gcc.gnu.org/ml/gcc-help/2009-04/msg00293.html ): $ gcc -Q --help=target -march=nocona | grep msse[23] -msse2 [disabled] -msse3 [disabled] -msse[23] would be enabled in gcc/config/i386/i386.c:override_options(), called from toplev.c:process_options(), which is in turn called from do_compile(). OTOH, --help=target is processed in decode_options(), which is executed before do_compile. It would be nice if --help=target processing could see options overridden by target backend.
Confirmed.
*** Bug 43718 has been marked as a duplicate of this bug. ***
*** Bug 53554 has been marked as a duplicate of this bug. ***
*** Bug 56507 has been marked as a duplicate of this bug. ***
Confirmed. $ diff -u0 <(gcc -Q -march=sandybridge --help=target) <(gcc -march=native -Q --help=target) --- /dev/fd/63 2017-07-22 14:49:57.839642336 -0500 +++ /dev/fd/62 2017-07-22 14:49:57.839642336 -0500 @@ -16 +16 @@ - -maes [disabled] + -maes [enabled] @@ -26 +26 @@ - -mavx [disabled] + -mavx [enabled] @@ -49 +49 @@ - -mcx16 [disabled] + -mcx16 [enabled] @@ -62 +62 @@ - -mfxsr [disabled] + -mfxsr [enabled] @@ -79 +79 @@ - -mmmx [disabled] + -mmmx [enabled] @@ -89 +89 @@ - -mno-sse4 [enabled] + -mno-sse4 [disabled] @@ -95 +95 @@ - -mpclmul [disabled] + -mpclmul [enabled] @@ -97 +97 @@ - -mpopcnt [disabled] + -mpopcnt [enabled] @@ -112 +112 @@ - -msahf [disabled] + -msahf [enabled] @@ -116,2 +116,2 @@ - -msse [disabled] - -msse2 [disabled] + -msse [enabled] + -msse2 [enabled] @@ -119,4 +119,4 @@ - -msse3 [disabled] - -msse4 [disabled] - -msse4.1 [disabled] - -msse4.2 [disabled] + -msse3 [enabled] + -msse4 [enabled] + -msse4.1 [enabled] + -msse4.2 [enabled] @@ -126 +126 @@ - -mssse3 [disabled] + -mssse3 [enabled] @@ -135 +135 @@ - -mtune= + -mtune= sandybridge @@ -142 +142 @@ - -mxsave [disabled] + -mxsave [enabled] @@ -144 +144 @@ - -mxsaveopt [disabled] + -mxsaveopt [enabled]
I've got a patch candidate, let's see what maintainers say about it.
Author: marxin Date: Tue Aug 29 07:46:10 2017 New Revision: 251400 URL: https://gcc.gnu.org/viewcvs?rev=251400&root=gcc&view=rev Log: Fix --help=target (PR other/39851). 2017-08-29 Martin Liska <mliska@suse.cz> PR other/39851 * gcc.c (driver_handle_option): Add new argument. * opts-common.c (handle_option): Pass target_option_override_hook. * opts-global.c (lang_handle_option): Add new option. (set_default_handlers): Add new argument. (decode_options): Likewise. * opts.c (target_handle_option): Likewise. (common_handle_option): Call target_option_override_hook. * opts.h (struct cl_option_handler_func): Add hook for target option override. (struct cl_option_handlers): Likewise. (set_default_handlers): Add new argument. (decode_options): Likewise. (common_handle_option): Likewise. (target_handle_option): Likewise. * toplev.c (toplev::main): Pass targetm.target_option.override hook. 2017-08-29 Martin Liska <mliska@suse.cz> PR other/39851 * c-common.c (parse_optimize_options): Add argument to function call. * c-pragma.c (handle_pragma_diagnostic): Likewise. Modified: trunk/gcc/ChangeLog trunk/gcc/c-family/ChangeLog trunk/gcc/c-family/c-common.c trunk/gcc/c-family/c-pragma.c trunk/gcc/gcc.c trunk/gcc/opts-common.c trunk/gcc/opts-global.c trunk/gcc/opts.c trunk/gcc/opts.h trunk/gcc/toplev.c
Fixed on trunk, queued for backporting.
Author: marxin Date: Tue Aug 29 08:35:46 2017 New Revision: 251406 URL: https://gcc.gnu.org/viewcvs?rev=251406&root=gcc&view=rev Log: Fix --help=target (Ada) (PR other/39851) 2017-08-29 Martin Liska <mliska@suse.cz> PR other/39851 * gcc-interface/trans.c (Pragma_to_gnu): Set argument to NULL. Modified: trunk/gcc/ada/ChangeLog trunk/gcc/ada/gcc-interface/trans.c
Author: aldyh Date: Wed Sep 13 17:34:49 2017 New Revision: 252599 URL: https://gcc.gnu.org/viewcvs?rev=252599&root=gcc&view=rev Log: Fix --help=target (PR other/39851). 2017-08-29 Martin Liska <mliska@suse.cz> PR other/39851 * gcc.c (driver_handle_option): Add new argument. * opts-common.c (handle_option): Pass target_option_override_hook. * opts-global.c (lang_handle_option): Add new option. (set_default_handlers): Add new argument. (decode_options): Likewise. * opts.c (target_handle_option): Likewise. (common_handle_option): Call target_option_override_hook. * opts.h (struct cl_option_handler_func): Add hook for target option override. (struct cl_option_handlers): Likewise. (set_default_handlers): Add new argument. (decode_options): Likewise. (common_handle_option): Likewise. (target_handle_option): Likewise. * toplev.c (toplev::main): Pass targetm.target_option.override hook. 2017-08-29 Martin Liska <mliska@suse.cz> PR other/39851 * c-common.c (parse_optimize_options): Add argument to function call. * c-pragma.c (handle_pragma_diagnostic): Likewise. Modified: branches/range-gen2/gcc/ChangeLog branches/range-gen2/gcc/c-family/ChangeLog branches/range-gen2/gcc/c-family/c-common.c branches/range-gen2/gcc/c-family/c-pragma.c branches/range-gen2/gcc/gcc.c branches/range-gen2/gcc/opts-common.c branches/range-gen2/gcc/opts-global.c branches/range-gen2/gcc/opts.c branches/range-gen2/gcc/opts.h branches/range-gen2/gcc/toplev.c
Author: aldyh Date: Wed Sep 13 17:35:13 2017 New Revision: 252601 URL: https://gcc.gnu.org/viewcvs?rev=252601&root=gcc&view=rev Log: Fix --help=target (Ada) (PR other/39851) 2017-08-29 Martin Liska <mliska@suse.cz> PR other/39851 * gcc-interface/trans.c (Pragma_to_gnu): Set argument to NULL. Modified: branches/range-gen2/gcc/ada/ChangeLog branches/range-gen2/gcc/ada/gcc-interface/trans.c
Author: marxin Date: Fri Sep 15 08:14:24 2017 New Revision: 252786 URL: https://gcc.gnu.org/viewcvs?rev=252786&root=gcc&view=rev Log: Backport r251406 2017-09-15 Martin Liska <mliska@suse.cz> Backport from mainline 2017-08-29 Martin Liska <mliska@suse.cz> PR other/39851 * gcc-interface/trans.c (Pragma_to_gnu): Set argument to NULL. Modified: branches/gcc-7-branch/gcc/ada/ChangeLog branches/gcc-7-branch/gcc/ada/gcc-interface/trans.c
Author: marxin Date: Fri Sep 15 08:18:34 2017 New Revision: 252787 URL: https://gcc.gnu.org/viewcvs?rev=252787&root=gcc&view=rev Log: Subject: Backport r251400 2017-09-15 Martin Liska <mliska@suse.cz> Backport from mainline 2017-08-29 Martin Liska <mliska@suse.cz> PR other/39851 * gcc.c (driver_handle_option): Add new argument. * opts-common.c (handle_option): Pass target_option_override_hook. * opts-global.c (lang_handle_option): Add new option. (set_default_handlers): Add new argument. (decode_options): Likewise. * opts.c (target_handle_option): Likewise. (common_handle_option): Call target_option_override_hook. * opts.h (struct cl_option_handler_func): Add hook for target option override. (struct cl_option_handlers): Likewise. (set_default_handlers): Add new argument. (decode_options): Likewise. (common_handle_option): Likewise. (target_handle_option): Likewise. * toplev.c (toplev::main): Pass targetm.target_option.override hook. 2017-09-15 Martin Liska <mliska@suse.cz> Backport from mainline 2017-08-29 Martin Liska <mliska@suse.cz> PR other/39851 * c-common.c (parse_optimize_options): Add argument to function call. * c-pragma.c (handle_pragma_diagnostic): Likewise. Modified: branches/gcc-7-branch/gcc/ChangeLog branches/gcc-7-branch/gcc/c-family/ChangeLog branches/gcc-7-branch/gcc/c-family/c-common.c branches/gcc-7-branch/gcc/c-family/c-pragma.c branches/gcc-7-branch/gcc/gcc.c branches/gcc-7-branch/gcc/opts-common.c branches/gcc-7-branch/gcc/opts-global.c branches/gcc-7-branch/gcc/opts.c branches/gcc-7-branch/gcc/opts.h branches/gcc-7-branch/gcc/toplev.c
Author: marxin Date: Fri Sep 15 09:19:36 2017 New Revision: 252797 URL: https://gcc.gnu.org/viewcvs?rev=252797&root=gcc&view=rev Log: Backport r251400 2017-09-15 Martin Liska <mliska@suse.cz> Backport from mainline 2017-08-29 Martin Liska <mliska@suse.cz> PR other/39851 * gcc.c (driver_handle_option): Add new argument. * opts-common.c (handle_option): Pass target_option_override_hook. * opts-global.c (lang_handle_option): Add new option. (set_default_handlers): Add new argument. (decode_options): Likewise. * opts.c (target_handle_option): Likewise. (common_handle_option): Call target_option_override_hook. * opts.h (struct cl_option_handler_func): Add hook for target option override. (struct cl_option_handlers): Likewise. (set_default_handlers): Add new argument. (decode_options): Likewise. (common_handle_option): Likewise. (target_handle_option): Likewise. * toplev.c (toplev::main): Pass targetm.target_option.override hook. 2017-09-15 Martin Liska <mliska@suse.cz> Backport from mainline 2017-08-29 Martin Liska <mliska@suse.cz> PR other/39851 * c-common.c (parse_optimize_options): Add argument to function call. * c-pragma.c (handle_pragma_diagnostic): Likewise. Modified: branches/gcc-6-branch/gcc/ChangeLog branches/gcc-6-branch/gcc/c-family/ChangeLog branches/gcc-6-branch/gcc/c-family/c-common.c branches/gcc-6-branch/gcc/c-family/c-pragma.c branches/gcc-6-branch/gcc/gcc.c branches/gcc-6-branch/gcc/opts-common.c branches/gcc-6-branch/gcc/opts-global.c branches/gcc-6-branch/gcc/opts.c branches/gcc-6-branch/gcc/opts.h branches/gcc-6-branch/gcc/toplev.c
Author: marxin Date: Fri Sep 15 09:20:37 2017 New Revision: 252798 URL: https://gcc.gnu.org/viewcvs?rev=252798&root=gcc&view=rev Log: Backport r251406 2017-09-15 Martin Liska <mliska@suse.cz> Backport from mainline 2017-08-29 Martin Liska <mliska@suse.cz> PR other/39851 * gcc-interface/trans.c (Pragma_to_gnu): Set argument to NULL. Modified: branches/gcc-6-branch/gcc/ada/ChangeLog branches/gcc-6-branch/gcc/ada/gcc-interface/trans.c
Fixed on GCC 6 and 7 branches, no plans for 5 branch because it's more complicated to backport.
Thanks for all your work on this Martin. I've put a script up on my github account (https://github.com/daniel-santos/distccflags), updated the Gentoo Distcc instructions and sent distcc a mail to notify them. Thanks!
(In reply to Daniel Santos from comment #17) > Thanks for all your work on this Martin. I've put a script up on my github > account (https://github.com/daniel-santos/distccflags), updated the Gentoo > Distcc instructions and sent distcc a mail to notify them. > > Thanks! Good to hear it helped ;)