https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117875

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
I tried get_range_query (cfun)->range_of_expr (vr, niter->niter, stmt) with
(unsigned int) M_9(D) - (unsigned int) k_24 and an enabled ranger
but that indeed returns [irange] unsigned int [0, 1024][4294966273, +INF]
and not a singleton as expected.
It seems to look for ranges of M_9 and k_24 and fold_range with the
minus op rather than trying to use relations to simplify the subtraction.
The ranges of the first and 2nd op are [1, 1025] and [1, 1024] respectively,
basically [1, INF] for our purpose (the constant array bound bounds them).

We'd also miss a way to inject niter->assumptions and niter->may_be_zero
as conditions known true for the purpose of simplifying (in this case
those don't add anything).

Reply via email to