https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126217
Bug ID: 126217
Summary: check_out_of_bounds_and_warn uses get_legacy_range
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Keywords: internal-improvement
Severity: enhancement
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
; /* Do nothing. */
else if (get_legacy_range (*vr, min, max) == VR_ANTI_RANGE)
{
if (up_bound
&& TREE_CODE (up_sub) == INTEGER_CST
&& (ignore_off_by_one
? tree_int_cst_lt (up_bound, up_sub)
: tree_int_cst_le (up_bound, up_sub))
&& TREE_CODE (low_sub) == INTEGER_CST
&& tree_int_cst_le (low_sub, low_bound))
{
*out_of_bound = true;
if (for_array_bound)
warned = warning_at (&richloc, OPT_Warray_bounds_,
"array subscript [%E, %E] is outside "
"array bounds of %qT",
low_sub, up_sub, artype);
}
}