This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH][RFC] Patch candidate for other/39851
On 08/28/2017 05:59 PM, Joseph Myers wrote:
> On Tue, 8 Aug 2017, Martin Liška wrote:
>> 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).
Thanks for the review. I've just installed the patch and a small fallout for Ada.
>From 891cac45682dddbecb343c3a7660ea0ab264373e Mon Sep 17 00:00:00 2001
From: marxin <email@example.com>
Date: Tue, 29 Aug 2017 10:34:32 +0200
Subject: [PATCH] Fix --help=target (Ada) (PR other/39851)
2017-08-29 Martin Liska <firstname.lastname@example.org>
* gcc-interface/trans.c (Pragma_to_gnu): Set argument to NULL.
gcc/ada/gcc-interface/trans.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index 67044b7b574..c0c6fb30915 100644
@@ -1486,7 +1486,7 @@ Pragma_to_gnu (Node_Id gnat_node)
option_index = 0;
- set_default_handlers (&handlers);
+ set_default_handlers (&handlers, NULL);
control_warning_option (option_index, (int) kind, arg, imply, location,
lang_mask, &handlers, &global_options,