Commit e06c0feb by Nathan Sidwell Committed by Nathan Sidwell

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
parent 07c65e00
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
......
......@@ -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;
}
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment