diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2004-12-01 16:46:25 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2004-12-01 16:46:25 +0000 |
commit | e06c0febd9372024c10fd6fab64bb212e2975106 (patch) | |
tree | 68b4dba3e71746f5a25ddc90900e8d44323f79f8 /gcc/params.c | |
parent | 07c65e005e3c402d07297b9ce4df2e5ef5f433e2 (diff) | |
download | gcc-e06c0febd9372024c10fd6fab64bb212e2975106.zip gcc-e06c0febd9372024c10fd6fab64bb212e2975106.tar.gz gcc-e06c0febd9372024c10fd6fab64bb212e2975106.tar.bz2 |
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
Diffstat (limited to 'gcc/params.c')
-rw-r--r-- | gcc/params.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/params.c b/gcc/params.c index b0dc375..cc55fae 100644 --- a/gcc/params.c +++ b/gcc/params.c @@ -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; } |