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.
This commit is contained in:
Martin Liska 2021-10-25 16:54:22 +02:00
parent a11c53985a
commit 679652a77d
3 changed files with 6 additions and 4 deletions

View file

@ -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

View file

@ -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

View file

@ -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=