summaryrefslogtreecommitdiff
path: root/gcc/opts.c
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-11 12:28:40 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-11 12:28:40 +0000
commit686e27690af4295ea88041c1d2d7fd31ee8f1cb7 (patch)
tree10941206f59ba4ef8b1a814126f81d1e02f511d4 /gcc/opts.c
parent07b87b7fcb73a27a489c209747c61b79a088563a (diff)
downloadgcc-686e27690af4295ea88041c1d2d7fd31ee8f1cb7.tar.gz
* params.c (set_param_value_internal): New.
(set_param_value): Use set_param_value_internal. (maybe_set_param_value, set_default_param_value): New. * params.h (PARAM_VALUE, PARAM_SET_P): Make into rvalues. (maybe_set_param_value, set_default_param_value): Declare. * config/arm/arm.c (arm_option_override): Use maybe_set_param_value. * config/i386/i386.c (ix86_option_override_internal): Use maybe_set_param_value. * config/ia64/ia64.c (ia64_option_default_params, TARGET_OPTION_DEFAULT_PARAMS): New. (ia64_option_optimization): Move some code to ia64_option_default_params. * config/picochip/picochip.c (picochip_option_override): Use maybe_set_param_value. * config/rs6000/rs6000.c (rs6000_option_default_params, TARGET_OPTION_DEFAULT_PARAMS): New. (rs6000_option_override_internal): Use maybe_set_param_value. (rs6000_option_optimization): Move some code to rs6000_option_default_params. * config/s390/s390.c (s390_option_override): Use maybe_set_param_value. * config/sh/sh.c (sh_option_default_params, TARGET_OPTION_DEFAULT_PARAMS): New. (sh_option_optimization): Move some code to sh_option_default_params. * config/sparc/sparc.c (sparc_option_override): Use maybe_set_param_value. * config/spu/spu.c (spu_option_default_params, TARGET_OPTION_DEFAULT_PARAMS): New. (spu_option_optimization): Move some code to spu_option_default_params. (spu_option_override): Use maybe_set_param_value. * doc/tm.texi.in (TARGET_OPTION_DEFAULT_PARAMS): New @hook. * doc/tm.texi: Regenerate. * ggc-common.c (init_ggc_heuristics): Use set_default_param_value. * opts.c (init_options_once): Use PARAM_VALUE not direct access to compiler_params. (default_options_optimization): Use maybe_set_param_value. (finish_options): Use maybe_set_param_value. * target.def (target_option.default_params): New hook. * toplev.c (general_init): Call targetm.target_option.default_params. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165303 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/opts.c')
-rw-r--r--gcc/opts.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/gcc/opts.c b/gcc/opts.c
index efee21e2323..38f2faa6b51 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -669,11 +669,11 @@ init_options_once (void)
/* Save initial values of parameters we reset. */
initial_min_crossjump_insns
- = compiler_params[PARAM_MIN_CROSSJUMP_INSNS].value;
+ = PARAM_VALUE (PARAM_MIN_CROSSJUMP_INSNS);
initial_max_fields_for_field_sensitive
- = compiler_params[PARAM_MAX_FIELDS_FOR_FIELD_SENSITIVE].value;
+ = PARAM_VALUE (PARAM_MAX_FIELDS_FOR_FIELD_SENSITIVE);
initial_loop_invariant_max_bbs_in_loop
- = compiler_params[PARAM_LOOP_INVARIANT_MAX_BBS_IN_LOOP].value;
+ = PARAM_VALUE (PARAM_LOOP_INVARIANT_MAX_BBS_IN_LOOP);
}
/* Initialize OPTS and OPTS_SET before using them in parsing options. */
@@ -853,12 +853,12 @@ default_options_optimization (struct gcc_options *opts,
flag_ipa_sra = opt2;
/* Track fields in field-sensitive alias analysis. */
- set_param_value ("max-fields-for-field-sensitive",
- (opt2) ? 100 : initial_max_fields_for_field_sensitive);
+ maybe_set_param_value (PARAM_MAX_FIELDS_FOR_FIELD_SENSITIVE,
+ opt2 ? 100 : initial_max_fields_for_field_sensitive);
/* For -O1 only do loop invariant motion for very small loops. */
- set_param_value ("loop-invariant-max-bbs-in-loop",
- (opt2) ? initial_loop_invariant_max_bbs_in_loop : 1000);
+ maybe_set_param_value (PARAM_LOOP_INVARIANT_MAX_BBS_IN_LOOP,
+ opt2 ? initial_loop_invariant_max_bbs_in_loop : 1000);
/* -O3 optimizations. */
opt3 = (optimize >= 3);
@@ -891,10 +891,11 @@ default_options_optimization (struct gcc_options *opts,
optimize = 2;
/* We want to crossjump as much as possible. */
- set_param_value ("min-crossjump-insns", 1);
+ maybe_set_param_value (PARAM_MIN_CROSSJUMP_INSNS, 1);
}
else
- set_param_value ("min-crossjump-insns", initial_min_crossjump_insns);
+ maybe_set_param_value (PARAM_MIN_CROSSJUMP_INSNS,
+ initial_min_crossjump_insns);
/* -Ofast adds optimizations to -O3. */
if (ofast)
@@ -1114,10 +1115,8 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set)
if (flag_conserve_stack)
{
- if (!PARAM_SET_P (PARAM_LARGE_STACK_FRAME))
- PARAM_VALUE (PARAM_LARGE_STACK_FRAME) = 100;
- if (!PARAM_SET_P (PARAM_STACK_FRAME_GROWTH))
- PARAM_VALUE (PARAM_STACK_FRAME_GROWTH) = 40;
+ maybe_set_param_value (PARAM_LARGE_STACK_FRAME, 100);
+ maybe_set_param_value (PARAM_STACK_FRAME_GROWTH, 40);
}
if (flag_wpa || flag_ltrans)
{