aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2021-10-25 16:54:22 +0200
committerMartin Liska <mliska@suse.cz>2021-11-01 20:29:19 +0100
commit679652a77da60078392a834ed4b6b910127dbf24 (patch)
tree0e8e107e34fa3c4fdd90ed4987f1fb1966af52e9 /gcc
parenta11c53985a7080f9bf6143788ccb455dc9b0da21 (diff)
downloadgcc-679652a77da60078392a834ed4b6b910127dbf24.zip
gcc-679652a77da60078392a834ed4b6b910127dbf24.tar.gz
gcc-679652a77da60078392a834ed4b6b910127dbf24.tar.bz2
Fix negative integer range for UInteger.
gcc/ChangeLog: * opt-functions.awk: Add new sanity checking. * optc-gen.awk: Add new argument to integer_range_info. * params.opt: Update 2 params which have negative IntegerRange.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/opt-functions.awk4
-rw-r--r--gcc/optc-gen.awk2
-rw-r--r--gcc/params.opt4
3 files changed, 6 insertions, 4 deletions
diff --git a/gcc/opt-functions.awk b/gcc/opt-functions.awk
index be92550..9bc8560 100644
--- a/gcc/opt-functions.awk
+++ b/gcc/opt-functions.awk
@@ -356,7 +356,7 @@ function search_var_name(name, opt_numbers, opts, flags, n_opts)
return ""
}
-function integer_range_info(range_option, init, option)
+function integer_range_info(range_option, init, option, uinteger_used)
{
if (range_option != "") {
ival = init + 0;
@@ -364,6 +364,8 @@ function integer_range_info(range_option, init, option)
end = nth_arg(1, range_option) + 0;
if (init != "" && init != "-1" && (ival < start || ival > end))
print "#error initial value " init " of '" option "' must be in range [" start "," end "]"
+ if (uinteger_used && start < 0)
+ print "#error '" option"': negative IntegerRange (" start ", " end ") cannot be combined with UInteger"
return start ", " end
}
else
diff --git a/gcc/optc-gen.awk b/gcc/optc-gen.awk
index 77e598e..ebc1a02 100644
--- a/gcc/optc-gen.awk
+++ b/gcc/optc-gen.awk
@@ -422,7 +422,7 @@ for (i = 0; i < n_opts; i++) {
cl_flags, cl_bit_fields)
printf(" %s, %s, %s }%s\n", var_ref(opts[i], flags[i]),
var_set(flags[i]), integer_range_info(opt_args("IntegerRange", flags[i]),
- opt_args("Init", flags[i]), opts[i]), comma)
+ opt_args("Init", flags[i]), opts[i], flag_set_p("UInteger", flags[i])), comma)
# Bump up the informational option index.
++optindex
diff --git a/gcc/params.opt b/gcc/params.opt
index 7ee7820..8c5948f 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -402,7 +402,7 @@ Common Joined UInteger Var(param_lim_expensive) Init(20) Param Optimization
The minimum cost of an expensive expression in the loop invariant motion.
-param=logical-op-non-short-circuit=
-Common Joined UInteger Var(param_logical_op_non_short_circuit) Init(-1) IntegerRange(-1, 1) Param
+Common Joined UInteger Var(param_logical_op_non_short_circuit) Init(-1) IntegerRange(0, 1) Param
True if a non-short-circuit operation is optimal.
-param=loop-block-tile-size=
@@ -1132,7 +1132,7 @@ Common Joined UInteger Var(param_vect_epilogues_nomask) Init(1) IntegerRange(0,
Enable loop epilogue vectorization using smaller vector size.
-param=vect-max-peeling-for-alignment=
-Common Joined UInteger Var(param_vect_max_peeling_for_alignment) Init(-1) IntegerRange(-1, 64) Param Optimization
+Common Joined UInteger Var(param_vect_max_peeling_for_alignment) Init(-1) IntegerRange(0, 64) Param Optimization
Maximum number of loop peels to enhance alignment of data references in a loop.
-param=vect-max-version-for-alias-checks=