https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125592
Andrew Macleod <amacleod at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |amacleod at redhat dot com
--- Comment #1 from Andrew Macleod <amacleod at redhat dot com> ---
(In reply to Drea Pinski from comment #0)
>
> VRP knows the 0x40 is set in t_4.
> From evrp:
> t_4 [irange] int [-2147483584, -897][64, 2147482751] MASK 0xfffffc3f VALUE
> 0x40
> <bb 3> :
> t_5 = t_4 | 64;
>
> But it does not remove the BIT_IOR_EXPR here.
That would be simplify_using_ranges::simplify_bit_ops_using_ranges I suspect...
I think it still uses the old VRP "mechanism" for processing bits and has never
been really reworked.
Mainly it looks like vr_set_zero_nonzero_bits() has never been adapted to
multi-range iranges, and simply uses the uppen and lower bounds
static bool
vr_set_zero_nonzero_bits (const tree expr_type,
const irange *vr,
wide_int *may_be_nonzero,
wide_int *must_be_nonzero)
{
if (vr->varying_p () || vr->undefined_p ())
{
*may_be_nonzero = wi::minus_one (TYPE_PRECISION (expr_type));
*must_be_nonzero = wi::zero (TYPE_PRECISION (expr_type));
return false;
}
wi_set_zero_nonzero_bits (expr_type, vr->lower_bound (), vr->upper_bound (),
*may_be_nonzero, *must_be_nonzero);
return true;
}
Is there any reason not to just use bitmasks for this whole thing?