Unify range_of_address with other range_of_* routines.

When range_of_address is called, we return immeidately, missing any
potential post calculation processing.

	* gimple-range-fold.cc (fold_using_range::fold_stmt): Move
	range_of_address call into nested 'if' with other routines.
This commit is contained in:
Andrew MacLeod
2025-12-17 09:34:28 -05:00
parent 6eabacf9fb
commit cb326dd0e1

View File

@@ -668,16 +668,14 @@ fold_using_range::fold_stmt (vrange &r, gimple *s, fur_source &src, tree name)
name = gimple_get_lhs (s);
// Process addresses and loads from static constructors.
if (gimple_code (s) == GIMPLE_ASSIGN)
{
if (gimple_assign_rhs_code (s) == ADDR_EXPR)
return range_of_address (as_a <prange> (r), s, src);
if (range_from_readonly_var (r, s))
return true;
}
if (gimple_code (s) == GIMPLE_ASSIGN && range_from_readonly_var (r, s))
return true;
gimple_range_op_handler handler (s);
if (handler)
if (gimple_code (s) == GIMPLE_ASSIGN
&& gimple_assign_rhs_code (s) == ADDR_EXPR)
res = range_of_address (as_a <prange> (r), s, src);
else if (handler)
res = range_of_range_op (r, handler, src);
else if (is_a<gphi *>(s))
res = range_of_phi (r, as_a<gphi *> (s), src);