/* Add any builtin functions with the new isa if any. */
ix86_add_new_builtins (opts->x_ix86_isa_flags, opts->x_ix86_isa_flags2);
+ enum excess_precision orig_ix86_excess_precision
+ = opts->x_ix86_excess_precision;
+ bool orig_ix86_unsafe_math_optimizations
+ = opts->x_ix86_unsafe_math_optimizations;
+ opts->x_ix86_excess_precision = opts->x_flag_excess_precision;
+ opts->x_ix86_unsafe_math_optimizations
+ = opts->x_flag_unsafe_math_optimizations;
+
/* Save the current options unless we are validating options for
#pragma. */
t = build_target_option_node (opts, opts_set);
opts->x_ix86_tune_string = orig_tune_string;
opts_set->x_ix86_fpmath = orig_fpmath_set;
opts_set->x_prefer_vector_width_type = orig_pvw_set;
+ opts->x_ix86_excess_precision = orig_ix86_excess_precision;
+ opts->x_ix86_unsafe_math_optimizations
+ = orig_ix86_unsafe_math_optimizations;
release_options_strings (option_strings);
}
/* Save the initial options in case the user does function specific
options. */
if (main_args_p)
- target_option_default_node = target_option_current_node
- = build_target_option_node (opts, opts_set);
+ {
+ opts->x_ix86_excess_precision
+ = opts->x_flag_excess_precision;
+ opts->x_ix86_unsafe_math_optimizations
+ = opts->x_flag_unsafe_math_optimizations;
+ target_option_default_node = target_option_current_node
+ = build_target_option_node (opts, opts_set);
+ }
if (opts->x_flag_cf_protection != CF_NONE)
opts->x_flag_cf_protection
else
TREE_TARGET_GLOBALS (new_tree) = save_target_globals_default_opts ();
}
+ else if (flag_unsafe_math_optimizations
+ != TREE_TARGET_OPTION (new_tree)->x_ix86_unsafe_math_optimizations
+ || (flag_excess_precision
+ != TREE_TARGET_OPTION (new_tree)->x_ix86_excess_precision))
+ {
+ cl_target_option_restore (&global_options, &global_options_set,
+ TREE_TARGET_OPTION (new_tree));
+ ix86_excess_precision = flag_excess_precision;
+ ix86_unsafe_math_optimizations = flag_unsafe_math_optimizations;
+ DECL_FUNCTION_SPECIFIC_TARGET (fndecl) = new_tree
+ = build_target_option_node (&global_options, &global_options_set);
+ if (TREE_TARGET_GLOBALS (new_tree))
+ restore_target_globals (TREE_TARGET_GLOBALS (new_tree));
+ else if (new_tree == target_option_default_node)
+ restore_target_globals (&default_target_globals);
+ else
+ TREE_TARGET_GLOBALS (new_tree) = save_target_globals_default_opts ();
+ }
ix86_previous_fndecl = fndecl;
static bool prev_no_caller_saved_registers;
apparently at random. */
static enum flt_eval_method
-ix86_excess_precision (enum excess_precision_type type)
+ix86_get_excess_precision (enum excess_precision_type type)
{
switch (type)
{
#define TARGET_MD_ASM_ADJUST ix86_md_asm_adjust
#undef TARGET_C_EXCESS_PRECISION
-#define TARGET_C_EXCESS_PRECISION ix86_excess_precision
+#define TARGET_C_EXCESS_PRECISION ix86_get_excess_precision
#undef TARGET_PROMOTE_PROTOTYPES
#define TARGET_PROMOTE_PROTOTYPES hook_bool_const_tree_true
#undef TARGET_SETUP_INCOMING_VARARGS
SFmode, DFmode and XFmode) in the current excess precision
configuration. */
#define X87_ENABLE_ARITH(MODE) \
- (flag_unsafe_math_optimizations \
- || flag_excess_precision == EXCESS_PRECISION_FAST \
+ (ix86_unsafe_math_optimizations \
+ || ix86_excess_precision == EXCESS_PRECISION_FAST \
|| (MODE) == XFmode)
/* Likewise, whether to allow direct conversions from integer mode
IMODE (HImode, SImode or DImode) to MODE. */
#define X87_ENABLE_FLOAT(MODE, IMODE) \
- (flag_unsafe_math_optimizations \
- || flag_excess_precision == EXCESS_PRECISION_FAST \
+ (ix86_unsafe_math_optimizations \
+ || ix86_excess_precision == EXCESS_PRECISION_FAST \
|| (MODE) == XFmode \
|| ((MODE) == DFmode && (IMODE) == SImode) \
|| (IMODE) == HImode)