===================================================================
@@ -30,6 +30,9 @@ TargetSave
HOST_WIDE_INT x_rs6000_isa_flags
;; Miscellaneous flag bits that were set explicitly by the user
+Variable
+HOST_WIDE_INT rs6000_isa_flags_explicit
+
TargetSave
HOST_WIDE_INT x_rs6000_isa_flags_explicit
Then in your option override function, initialize it from the
global_set.target_flags:
===================================================================
@@ -2796,6 +2796,10 @@ rs6000_option_override_internal (bool gl
= ((global_init_p || target_option_default_node == NULL)
? NULL : TREE_TARGET_OPTION (target_option_default_node));
+ /* Remember the explicit arguments. */
+ if (global_init_p)
+ rs6000_isa_flags_explicit = global_options_set.x_rs6000_isa_flags;
+
/* On 64-bit Darwin, power alignment is ABI-incompatible with some C
library functions, so warn about it. The flag may be useful for
performance studies from time to time though, so don't disable it
If you have target specific save/restore functions, you need to deal with the
gcc_options argument. I think it should use a field in the gcc_options
structure, which was the point of creating the variable in the .opt file
above. That way, when the save/restore function are called in the future not
using the global switches, it will continue to work. Here is the rs6000
changes:
===================================================================
@@ -29995,19 +29999,22 @@ rs6000_set_current_function (tree fndecl
/* Save the current options */
static void
-rs6000_function_specific_save (struct cl_target_option *ptr)
+rs6000_function_specific_save (struct cl_target_option *ptr,
+ struct gcc_options *opts)
{
- ptr->x_rs6000_isa_flags = rs6000_isa_flags;
- ptr->x_rs6000_isa_flags_explicit = rs6000_isa_flags_explicit;
+ ptr->x_rs6000_isa_flags = opts->x_rs6000_isa_flags;
+ ptr->x_rs6000_isa_flags_explicit = opts->x_rs6000_isa_flags_explicit;
}
/* Restore the current options */
static void
-rs6000_function_specific_restore (struct cl_target_option *ptr)
+rs6000_function_specific_restore (struct gcc_options *opts,
+ struct cl_target_option *ptr)
+
{
- rs6000_isa_flags = ptr->x_rs6000_isa_flags;
- rs6000_isa_flags_explicit = ptr->x_rs6000_isa_flags_explicit;
+ opts->x_rs6000_isa_flags = ptr->x_rs6000_isa_flags;
+ opts->x_rs6000_isa_flags_explicit = ptr->x_rs6000_isa_flags_explicit;
(void) rs6000_option_override_internal (false);
}
The last change was to remove the rs6000_isa_flags_explicit declaration in
rs6000.h. If you are using target_flags_explicit, you probably don't need
this.
===================================================================
@@ -593,9 +593,6 @@ extern int rs6000_vector_align[];
#define MASK_PROTOTYPE OPTION_MASK_PROTOTYPE
#endif
-/* Explicit ISA options that were set. */
-#define rs6000_isa_flags_explicit global_options_set.x_rs6000_isa_flags
-
/* For power systems, we want to enable Altivec and VSX builtins even if the
user did not use -maltivec or -mvsx to allow the builtins to be used inside
of #pragma GCC target or the target attribute to change the code level for a