2016-12-15 Richard Earnshaw <rearnsha@arm.com>
+ * arm-protos.h (arm_configure_build_target): Change second argument
+ to cl_target_options.
+ * arm.c (arm_configure_build_target): Likewise.
+ (arm_option_restore): Update accordingly.
+ (arm_option_override): Create the target_option_default_node before
+ calling arm_configure_build_target. Use it in call of latter.
+ Resynchronize after all other overrides have been calculated.
+ (arm_valid_target_attribute_tree): Use the target options for
+ reconfiguration. Resynchronize after performing override checks.
+ * arm-c.c (arm_pragma_target_parse): Use target optiosn from cur_tree
+ to reconfigure the build target.
+
+2016-12-15 Richard Earnshaw <rearnsha@arm.com>
+
* arm.h (TARGET_VFPD32): Use arm_active_target.
(TARGET_VFP3): Likewise.
(TARGET_VFP5): Likewise.
static void
arm_override_options_after_change (void)
{
- arm_configure_build_target (&arm_active_target, &global_options,
+ arm_configure_build_target (&arm_active_target,
+ TREE_TARGET_OPTION (target_option_default_node),
&global_options_set, false);
arm_override_options_after_change_1 (&global_options);
}
static void
-arm_option_restore (struct gcc_options *opts, struct cl_target_option *ptr)
+arm_option_restore (struct gcc_options *, struct cl_target_option *ptr)
{
- arm_configure_build_target (&arm_active_target, opts, &global_options_set,
+ arm_configure_build_target (&arm_active_target, ptr, &global_options_set,
false);
}
architecture have been specified, but the two are not identical. */
void
arm_configure_build_target (struct arm_build_target *target,
- struct gcc_options *opts,
+ struct cl_target_option *opts,
struct gcc_options *opts_set,
bool warn_compatible)
{
gcc_assert (ok);
}
- arm_configure_build_target (&arm_active_target, &global_options,
+ /* Create the default target_options structure. We need this early
+ to configure the overall build target. */
+ target_option_default_node = target_option_current_node
+ = build_target_option_node (&global_options);
+
+ arm_configure_build_target (&arm_active_target,
+ TREE_TARGET_OPTION (target_option_default_node),
&global_options_set, true);
#ifdef SUBTARGET_OVERRIDE_OPTIONS
arm_option_check_internal (&global_options);
arm_option_params_internal ();
+ /* Resynchronize the saved target options. */
+ cl_target_option_save (TREE_TARGET_OPTION (target_option_default_node),
+ &global_options);
/* Register global variables with the garbage collector. */
arm_add_gc_roots ();
- /* Save the initial options in case the user does function specific
- options or #pragma target. */
- target_option_default_node = target_option_current_node
- = build_target_option_node (&global_options);
-
/* Init initial mode for testing. */
thumb_flipper = TARGET_THUMB;
}
arm_valid_target_attribute_tree (tree args, struct gcc_options *opts,
struct gcc_options *opts_set)
{
+ tree t;
+
if (!arm_valid_target_attribute_rec (args, opts))
return NULL_TREE;
- arm_configure_build_target (&arm_active_target, opts, opts_set, false);
+ t = build_target_option_node (opts);
+ arm_configure_build_target (&arm_active_target, TREE_TARGET_OPTION (t),
+ opts_set, false);
arm_option_check_internal (opts);
/* Do any overrides, such as global options arch=xxx. */
arm_option_override_internal (opts, opts_set);
- return build_target_option_node (opts);
+ /* Resynchronize the saved target options. */
+ cl_target_option_save (TREE_TARGET_OPTION (t), opts);
+
+ return t;
}
static void