[Bug middle-end/125767] can_div_away_from_zero_p incorrectly depends on can_div_trunc_p succeeding
Chris.Bazley at arm dot com
gcc-bugzilla@gcc.gnu.org
Fri Jun 12 15:16:11 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125767
--- Comment #6 from Christopher Bazley <Chris.Bazley at arm dot com> ---
(In reply to Richard Sandiford from comment #5)
> (In reply to Christopher Bazley from comment #4)
> > it would be possible to work around the issue
> I wasn't suggesting that. I agree the case should be added. I was just
> saying that...
>
> > but I reported it as a bug
> > because the function does not seem to behave according to its documented
> > contract.
> ...this function, like several others in poly-int.h, is "best effort".
> Returning false does not mean that no solution is possible.
>
> So the function is behaving according to its contract. It's just not
> handling all cases in the best possible way.
>
> This is similar to how, for example, the routines that ask "can these two
> memory accesses alias?" act conservatively. Returning true (in that case)
> does not mean that no technique exists for telling them apart. New
> techniques can be added as we need them.
Thanks for your explanation.
More information about the Gcc-bugs
mailing list