https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96697
--- Comment #6 from Jakub Jelinek ---
For signed x and y, x % y == x % -y, x % y has the sign of x. So for x in
non-negative you can use x % y < abs(y) and generally -abs(y) < x % y < abs(y)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96697
Andrew Pinski changed:
What|Removed |Added
Severity|normal |enhancement
Keywords|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96697
--- Comment #5 from Andrew Macleod ---
(In reply to Andrew Macleod from comment #4)
> (In reply to Jakub Jelinek from comment #2)
> > Shall we do that as a specific matcher or e.g. in the ranger once it gets
> > code for symbolic comparisons? I
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96697
--- Comment #4 from Andrew Macleod ---
(In reply to Jakub Jelinek from comment #2)
> Shall we do that as a specific matcher or e.g. in the ranger once it gets
> code for symbolic comparisons? I mean, for signed t = x % y note that t is
> in [-y
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96697
--- Comment #3 from Jakub Jelinek ---
On the other side, we do have:
/* X % Y is smaller than Y. */
(for cmp (lt ge)
(simplify
(cmp (trunc_mod @0 @1) @1)
(if (TYPE_UNSIGNED (TREE_TYPE (@0)))
{ constant_boolean_node (cmp == LT_EXPR, type)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96697
Jakub Jelinek changed:
What|Removed |Added
CC||amacleod at redhat dot com,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96697
Richard Biener changed:
What|Removed |Added
Ever confirmed|0 |1
Status|UNCONFIRMED