re PR middle-end/18667 (ice with --parm integer-share-limit=0)

PR middle-end/18667
	* params.c (set_param_value): Add range check.
	* params.def: Add min and max values. Reformat long strings.
	* params.h (struct param_info): Add min and max fields.
	(enum compiler_param): Adjust DEFPARAM.
	* toplev.c (lang_independent_params): Likewise.

From-SVN: r91567
This commit is contained in:
Nathan Sidwell 2004-12-01 16:46:25 +00:00 committed by Nathan Sidwell
parent 07c65e005e
commit e06c0febd9
5 changed files with 105 additions and 93 deletions

View File

@ -1,3 +1,12 @@
2004-12-01 Nathan Sidwell <nathan@codesourcery.com>
PR middle-end/18667
* params.c (set_param_value): Add range check.
* params.def: Add min and max values. Reformat long strings.
* params.h (struct param_info): Add min and max fields.
(enum compiler_param): Adjust DEFPARAM.
* toplev.c (lang_independent_params): Likewise.
2004-12-01 Alan Modra <amodra@bigpond.net.au>
PR target/12817

View File

@ -68,7 +68,17 @@ set_param_value (const char *name, int value)
for (i = 0; i < num_compiler_params; ++i)
if (strcmp (compiler_params[i].option, name) == 0)
{
compiler_params[i].value = value;
if (value < compiler_params[i].min_value)
error ("minimum value of parameter %qs is %u",
compiler_params[i].option,
compiler_params[i].min_value);
else if (compiler_params[i].max_value > compiler_params[i].min_value
&& value > compiler_params[i].max_value)
error ("maximum value of parameter %qs is %u",
compiler_params[i].option,
compiler_params[i].max_value);
else
compiler_params[i].value = value;
return;
}

View File

@ -41,8 +41,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
itself. */
DEFPARAM (PARAM_SRA_MAX_STRUCTURE_SIZE,
"sra-max-structure-size",
"The maximum structure size (in bytes) at which GCC will do block copies.",
0)
"The maximum structure size (in bytes) at which GCC will do block copies",
0, 0, 0)
/* The ratio between instantiated fields and the complete structure
size. We say that if the ratio of the number of bytes in
@ -51,8 +51,8 @@ DEFPARAM (PARAM_SRA_MAX_STRUCTURE_SIZE,
The default is 75%. */
DEFPARAM (PARAM_SRA_FIELD_STRUCTURE_RATIO,
"sra-field-structure-ratio",
"The threshold ratio between instantiated fields and the total structure size.",
75)
"The threshold ratio between instantiated fields and the total structure size",
75, 0, 100)
/* The single function inlining limit. This is the maximum size
of a function counted in internal gcc instructions (not in
@ -70,7 +70,7 @@ DEFPARAM (PARAM_SRA_FIELD_STRUCTURE_RATIO,
DEFPARAM (PARAM_MAX_INLINE_INSNS_SINGLE,
"max-inline-insns-single",
"The maximum number of instructions in a single function eligible for inlining",
500)
500, 0, 0)
/* The single function inlining limit for functions that are
inlined by virtue of -finline-functions (-O3).
@ -82,27 +82,27 @@ DEFPARAM (PARAM_MAX_INLINE_INSNS_SINGLE,
DEFPARAM (PARAM_MAX_INLINE_INSNS_AUTO,
"max-inline-insns-auto",
"The maximum number of instructions when automatically inlining",
120)
120, 0, 0)
DEFPARAM (PARAM_MAX_INLINE_INSNS_RECURSIVE,
"max-inline-insns-recursive",
"The maximum number of instructions inline function can grow to via recursive inlining",
500)
500, 0, 0)
DEFPARAM (PARAM_MAX_INLINE_INSNS_RECURSIVE_AUTO,
"max-inline-insns-recursive-auto",
"The maximum number of instructions non-inline function can grow to via recursive inlining",
500)
500, 0, 0)
DEFPARAM (PARAM_MAX_INLINE_RECURSIVE_DEPTH,
"max-inline-recursive-depth",
"The maximum depth of recursive inlining for inline functions",
8)
8, 0, 0)
DEFPARAM (PARAM_MAX_INLINE_RECURSIVE_DEPTH_AUTO,
"max-inline-recursive-depth-auto",
"The maximum depth of recursive inlining for non-inline functions",
8)
8, 0, 0)
/* Limit the number of expansions created by the variable expansion
optimization to avoid register pressure. */
@ -111,7 +111,7 @@ DEFPARAM (PARAM_MAX_VARIABLE_EXPANSIONS,
"If -fvariable-expansion-in-unroller is used, the maximum number of \
times that an individual variable will be expanded \
during loop unrolling",
1)
1, 0, 0)
/* The maximum number of instructions to consider when looking for an
instruction to fill a delay slot. If more than this arbitrary
@ -122,7 +122,7 @@ DEFPARAM (PARAM_MAX_VARIABLE_EXPANSIONS,
DEFPARAM (PARAM_MAX_DELAY_SLOT_INSN_SEARCH,
"max-delay-slot-insn-search",
"The maximum number of instructions to consider to fill a delay slot",
100)
100, 0, 0)
/* When trying to fill delay slots, the maximum number of instructions
to consider when searching for a block with valid live register
@ -133,7 +133,7 @@ DEFPARAM (PARAM_MAX_DELAY_SLOT_INSN_SEARCH,
DEFPARAM(PARAM_MAX_DELAY_SLOT_LIVE_SEARCH,
"max-delay-slot-live-search",
"The maximum number of instructions to consider to find accurate live register information",
333)
333, 0, 0)
/* This parameter limits the number of branch elements that the
scheduler will track anti-dependencies through without resetting
@ -143,32 +143,32 @@ DEFPARAM(PARAM_MAX_DELAY_SLOT_LIVE_SEARCH,
DEFPARAM(PARAM_MAX_PENDING_LIST_LENGTH,
"max-pending-list-length",
"The maximum length of scheduling's pending operations list",
32)
32, 0, 0)
DEFPARAM(PARAM_LARGE_FUNCTION_INSNS,
"large-function-insns",
"The size of function body to be considered large",
3000)
3000, 0, 0)
DEFPARAM(PARAM_LARGE_FUNCTION_GROWTH,
"large-function-growth",
"Maximal growth due to inlining of large function (in percent)",
100)
100, 0, 0)
DEFPARAM(PARAM_INLINE_UNIT_GROWTH,
"inline-unit-growth",
"how much can given compilation unit grow because of the inlining (in percent)",
50)
50, 0, 0)
/* The GCSE optimization will be disabled if it would require
significantly more memory than this value. */
DEFPARAM(PARAM_MAX_GCSE_MEMORY,
"max-gcse-memory",
"The maximum amount of memory to be allocated by GCSE",
50 * 1024 * 1024)
50 * 1024 * 1024, 0, 0)
/* The number of repetitions of copy/const prop and PRE to run. */
DEFPARAM(PARAM_MAX_GCSE_PASSES,
"max-gcse-passes",
"The maximum number of passes to make when doing GCSE",
1)
1, 1, 0)
/* This is the threshold ratio when to perform partial redundancy
elimination after reload. We perform partial redundancy elimination
when the following holds:
@ -177,17 +177,15 @@ DEFPARAM(PARAM_MAX_GCSE_PASSES,
(Added loads execution count) */
DEFPARAM(PARAM_GCSE_AFTER_RELOAD_PARTIAL_FRACTION,
"gcse-after-reload-partial-fraction",
"The threshold ratio for performing partial redundancy elimination \
after reload.",
3)
"The threshold ratio for performing partial redundancy elimination after reload.",
3, 0, 0)
/* This is the threshold ratio of the critical edges execution count compared to
the redundant loads execution count that permits performing the load
redundancy elimination in gcse after reload. */
DEFPARAM(PARAM_GCSE_AFTER_RELOAD_CRITICAL_FRACTION,
"gcse-after-reload-critical-fraction",
"The threshold ratio of critical edges execution count that permit \
performing redundancy elimination after reload.",
10)
"The threshold ratio of critical edges execution count that permit performing redundancy elimination after reload.",
10, 0, 0)
/* This parameter limits the number of insns in a loop that will be unrolled,
and by how much the loop is unrolled.
@ -198,150 +196,139 @@ DEFPARAM(PARAM_GCSE_AFTER_RELOAD_CRITICAL_FRACTION,
DEFPARAM(PARAM_MAX_UNROLLED_INSNS,
"max-unrolled-insns",
"The maximum number of instructions to consider to unroll in a loop",
200)
200, 0, 0)
/* This parameter limits how many times the loop is unrolled depending
on number of insns really executed in each iteration. */
DEFPARAM(PARAM_MAX_AVERAGE_UNROLLED_INSNS,
"max-average-unrolled-insns",
"The maximum number of instructions to consider to unroll in a loop on average",
80)
80, 0, 0)
/* The maximum number of unrollings of a single loop. */
DEFPARAM(PARAM_MAX_UNROLL_TIMES,
"max-unroll-times",
"The maximum number of unrollings of a single loop",
8)
8, 0, 0)
/* The maximum number of insns of a peeled loop. */
DEFPARAM(PARAM_MAX_PEELED_INSNS,
"max-peeled-insns",
"The maximum number of insns of a peeled loop",
400)
400, 0, 0)
/* The maximum number of peelings of a single loop. */
DEFPARAM(PARAM_MAX_PEEL_TIMES,
"max-peel-times",
"The maximum number of peelings of a single loop",
16)
16, 0, 0)
/* The maximum number of insns of a peeled loop. */
DEFPARAM(PARAM_MAX_COMPLETELY_PEELED_INSNS,
"max-completely-peeled-insns",
"The maximum number of insns of a completely peeled loop",
400)
400, 0, 0)
/* The maximum number of peelings of a single loop that is peeled completely. */
DEFPARAM(PARAM_MAX_COMPLETELY_PEEL_TIMES,
"max-completely-peel-times",
"The maximum number of peelings of a single loop that is peeled completely",
16)
16, 0, 0)
/* The maximum number of insns of a peeled loop that rolls only once. */
DEFPARAM(PARAM_MAX_ONCE_PEELED_INSNS,
"max-once-peeled-insns",
"The maximum number of insns of a peeled loop that rolls only once",
400)
400, 0, 0)
/* The maximum number of insns of an unswitched loop. */
DEFPARAM(PARAM_MAX_UNSWITCH_INSNS,
"max-unswitch-insns",
"The maximum number of insns of an unswitched loop",
50)
50, 0, 0)
/* The maximum level of recursion in unswitch_single_loop. */
DEFPARAM(PARAM_MAX_UNSWITCH_LEVEL,
"max-unswitch-level",
"The maximum number of unswitchings in a single loop",
3)
3, 0, 0)
/* The maximum number of iterations of a loop the brute force algorithm
for analysis of # of iterations of the loop tries to evaluate. */
DEFPARAM(PARAM_MAX_ITERATIONS_TO_TRACK,
"max-iterations-to-track",
"Bound on the number of iterations the brute force # of iterations \
analysis algorithm evaluates",
1000)
"Bound on the number of iterations the brute force # of iterations analysis algorithm evaluates",
1000, 0, 0)
DEFPARAM(PARAM_MAX_SMS_LOOP_NUMBER,
"max-sms-loop-number",
"Maximum number of loops to perform swing modulo scheduling on \
(mainly for debugging)",
-1)
"Maximum number of loops to perform swing modulo scheduling on (mainly for debugging)",
-1, -1, -1)
/* This parameter is used to tune SMS MAX II calculations. */
DEFPARAM(PARAM_SMS_MAX_II_FACTOR,
"sms-max-ii-factor",
"A factor for tuning the upper bound that swing modulo scheduler uses \
for scheduling a loop",
100)
"A factor for tuning the upper bound that swing modulo scheduler uses for scheduling a loop",
100, 0, 0)
DEFPARAM(PARAM_SMS_DFA_HISTORY,
"sms-dfa-history",
"The number of cycles the swing modulo scheduler considers when \
checking conflicts using DFA",
0)
0, 0, 0)
DEFPARAM(PARAM_SMS_LOOP_AVERAGE_COUNT_THRESHOLD,
"sms-loop-average-count-threshold",
"A threshold on the average loop count considered by the swing modulo \
scheduler",
0)
"A threshold on the average loop count considered by the swing modulo scheduler",
0, 0, 0)
DEFPARAM(HOT_BB_COUNT_FRACTION,
"hot-bb-count-fraction",
"Select fraction of the maximal count of repetitions of basic block in \
program given basic block needs to have to be considered hot",
10000)
"Select fraction of the maximal count of repetitions of basic block in program given basic block needs to have to be considered hot",
10000, 0, 0)
DEFPARAM(HOT_BB_FREQUENCY_FRACTION,
"hot-bb-frequency-fraction",
"Select fraction of the maximal frequency of executions of basic \
block in function given basic block needs to have to be considered hot",
1000)
"Select fraction of the maximal frequency of executions of basic block in function given basic block needs to have to be considered hot",
1000, 0, 0)
DEFPARAM(TRACER_DYNAMIC_COVERAGE_FEEDBACK,
"tracer-dynamic-coverage-feedback",
"The percentage of function, weighted by execution frequency, that \
must be covered by trace formation. Used when profile feedback is available",
95)
"The percentage of function, weighted by execution frequency, that must be covered by trace formation. Used when profile feedback is available",
95, 0, 100)
DEFPARAM(TRACER_DYNAMIC_COVERAGE,
"tracer-dynamic-coverage",
"The percentage of function, weighted by execution frequency, that \
must be covered by trace formation. Used when profile feedback is not available",
75)
"The percentage of function, weighted by execution frequency, that must be covered by trace formation. Used when profile feedback is not available",
75, 0, 100)
DEFPARAM(TRACER_MAX_CODE_GROWTH,
"tracer-max-code-growth",
"Maximal code growth caused by tail duplication (in percent)",
100)
100, 0, 0)
DEFPARAM(TRACER_MIN_BRANCH_RATIO,
"tracer-min-branch-ratio",
"Stop reverse growth if the reverse probability of best edge is less \
than this threshold (in percent)",
10)
"Stop reverse growth if the reverse probability of best edge is less than this threshold (in percent)",
10, 0, 100)
DEFPARAM(TRACER_MIN_BRANCH_PROBABILITY_FEEDBACK,
"tracer-min-branch-probability-feedback",
"Stop forward growth if the probability of best edge is less than \
this threshold (in percent). Used when profile feedback is available",
80)
"Stop forward growth if the probability of best edge is less than this threshold (in percent). Used when profile feedback is available",
80, 0, 100)
DEFPARAM(TRACER_MIN_BRANCH_PROBABILITY,
"tracer-min-branch-probability",
"Stop forward growth if the probability of best edge is less than \
this threshold (in percent). Used when profile feedback is not available",
50)
"Stop forward growth if the probability of best edge is less than this threshold (in percent). Used when profile feedback is not available",
50, 0, 100)
/* The maximum number of incoming edges to consider for crossjumping. */
DEFPARAM(PARAM_MAX_CROSSJUMP_EDGES,
"max-crossjump-edges",
"The maximum number of incoming edges to consider for crossjumping",
100)
100, 0, 0)
/* The minimum number of matching instructions to consider for crossjumping. */
DEFPARAM(PARAM_MIN_CROSSJUMP_INSNS,
"min-crossjump-insns",
"The minimum number of matching instructions to consider for crossjumping",
5)
5, 0, 0)
/* The maximum length of path considered in cse. */
DEFPARAM(PARAM_MAX_CSE_PATH_LENGTH,
"max-cse-path-length",
"The maximum length of path considered in cse",
10)
10, 0, 0)
/* The cost of expression in loop invariant motion that is considered
expensive. */
DEFPARAM(PARAM_LIM_EXPENSIVE,
"lim-expensive",
"The minimum cost of an expensive expression in the loop invariant motion",
20)
20, 0, 0)
/* Bound on number of candidates for induction variables below that
all candidates are considered for each use in induction variable
@ -350,7 +337,7 @@ DEFPARAM(PARAM_LIM_EXPENSIVE,
DEFPARAM(PARAM_IV_CONSIDER_ALL_CANDIDATES_BOUND,
"iv-consider-all-candidates-bound",
"Bound on number of candidates below that all candidates are considered in iv optimizations",
30)
30, 0, 0)
/* The induction variable optimizations give up on loops that contain more
induction variable uses. */
@ -358,19 +345,19 @@ DEFPARAM(PARAM_IV_CONSIDER_ALL_CANDIDATES_BOUND,
DEFPARAM(PARAM_IV_MAX_CONSIDERED_USES,
"iv-max-considered-uses",
"Bound on number of iv uses in loop optimized in iv optimizations",
250)
250, 0, 0)
/* The product of the next two is used to decide whether or not to
use .GLOBAL_VAR. See tree-dfa.c. */
DEFPARAM(PARAM_GLOBAL_VAR_THRESHOLD,
"global-var-threshold",
"Given N calls and V call-clobbered vars in a function. Use .GLOBAL_VAR if NxV is larger than this limit",
500000)
500000, 0, 0)
DEFPARAM(PARAM_MAX_CSELIB_MEMORY_LOCATIONS,
"max-cselib-memory-locations",
"The maximum memory locations recorded by cselib",
500)
500, 0, 0)
#ifdef ENABLE_GC_ALWAYS_COLLECT
# define GGC_MIN_EXPAND_DEFAULT 0
@ -382,14 +369,13 @@ DEFPARAM(PARAM_MAX_CSELIB_MEMORY_LOCATIONS,
DEFPARAM(GGC_MIN_EXPAND,
"ggc-min-expand",
"Minimum heap expansion to trigger garbage collection, as \
a percentage of the total size of the heap",
GGC_MIN_EXPAND_DEFAULT)
"Minimum heap expansion to trigger garbage collection, as a percentage of the total size of the heap",
GGC_MIN_EXPAND_DEFAULT, 0, 0)
DEFPARAM(GGC_MIN_HEAPSIZE,
"ggc-min-heapsize",
"Minimum heap size before we start collecting garbage, in kilobytes",
GGC_MIN_HEAPSIZE_DEFAULT)
GGC_MIN_HEAPSIZE_DEFAULT, 0, 0)
#undef GGC_MIN_EXPAND_DEFAULT
#undef GGC_MIN_HEAPSIZE_DEFAULT
@ -397,22 +383,22 @@ DEFPARAM(GGC_MIN_HEAPSIZE,
DEFPARAM(PARAM_MAX_RELOAD_SEARCH_INSNS,
"max-reload-search-insns",
"The maximum number of instructions to search backward when looking for equivalent reload",
100)
100, 0, 0)
DEFPARAM(PARAM_MAX_ALIASED_VOPS,
"max-aliased-vops",
"The maximum number of virtual operands allowed to represent aliases before triggering alias grouping.",
500)
500, 0, 0)
DEFPARAM(PARAM_MAX_SCHED_REGION_BLOCKS,
"max-sched-region-blocks",
"The maximum number of blocks in a region to be considered for interblock scheduling",
10)
10, 0, 0)
DEFPARAM(PARAM_MAX_SCHED_REGION_INSNS,
"max-sched-region-insns",
"The maximum number of insns in a region to be considered for interblock scheduling",
100)
100, 0, 0)
/* INTEGER_CST nodes are shared for values [{-1,0} .. N) for
{signed,unsigned} integral types. This determines N.
@ -420,7 +406,7 @@ DEFPARAM(PARAM_MAX_SCHED_REGION_INSNS,
DEFPARAM (PARAM_INTEGER_SHARE_LIMIT,
"integer-share-limit",
"The upper bound for sharing integer constants",
256)
256, 2, 2)
/*
Local variables:

View File

@ -48,6 +48,13 @@ typedef struct param_info
const char *const option;
/* The associated value. */
int value;
/* Minimum acceptable value. */
int min_value;
/* Maxiumum acceptable value, if greater than minimum */
int max_value;
/* A short description of the option. */
const char *const help;
} param_info;
@ -70,7 +77,7 @@ extern void set_param_value (const char *name, int value);
typedef enum compiler_param
{
#define DEFPARAM(enumerator, option, msgid, default) \
#define DEFPARAM(enumerator, option, msgid, default, min, max) \
enumerator,
#include "params.def"
#undef DEFPARAM

View File

@ -367,11 +367,11 @@ int flag_evaluation_order = 0;
const char *user_label_prefix;
static const param_info lang_independent_params[] = {
#define DEFPARAM(ENUM, OPTION, HELP, DEFAULT) \
{ OPTION, DEFAULT, HELP },
#define DEFPARAM(ENUM, OPTION, HELP, DEFAULT, MIN, MAX) \
{ OPTION, DEFAULT, MIN, MAX, HELP },
#include "params.def"
#undef DEFPARAM
{ NULL, 0, NULL }
{ NULL, 0, 0, 0, NULL }
};
/* Here is a table, controlled by the tm.h file, listing each -m switch