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
jos...@codesourcery.com

Reply via email to