This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][RFC] Patch candidate for other/39851
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Martin Liška <mliska at suse dot cz>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Alexander Monakov <amonakov at ispras dot ru>
- Date: Mon, 28 Aug 2017 15:59:29 +0000
- Subject: Re: [PATCH][RFC] Patch candidate for other/39851
- Authentication-results: sourceware.org; auth=none
- References: <2eb93d20-71eb-0a4f-e323-18465ca485f4@suse.cz>
On Tue, 8 Aug 2017, Martin Liška wrote:
> Hi.
>
> As mentioned in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39851#c0 we need
> to call targetm.target_option.override () in order to properly report which
> ISA options are enabled for a -march/-mtune. Currently, opts.c uses just
> #include "common/common-target.h" we are unable to call the function direct.
> One solution might be to put the hook to gcc/common/common-target.def, but
> that would require huge refactoring of i386.c and i386-common.c files.
>
> Thus I came with a small hook that lives in cl_option_handler_func.
> With that I see proper results for test-case mentioned in the PR.
This patch is OK. As you note, making the targetm.target_option.override
hook into a common option would involve much refactoring, because many of
those hooks mix things acting purely on the options structure (which could
readily become common) and things relating to other back-end state (which
would need to stay in a hook that's only used in the compiler proper, not
the driver).
--
Joseph S. Myers
joseph@codesourcery.com