[Bug tree-optimization/96697] Failure to optimize mod+div to 0

2021-08-15 Thread jakub at gcc dot gnu.org via Gcc-bugs
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)

[Bug tree-optimization/96697] Failure to optimize mod+div to 0

2021-08-15 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96697 Andrew Pinski changed: What|Removed |Added Severity|normal |enhancement Keywords|

[Bug tree-optimization/96697] Failure to optimize mod+div to 0

2021-07-12 Thread amacleod at redhat dot com via Gcc-bugs
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

[Bug tree-optimization/96697] Failure to optimize mod+div to 0

2021-01-04 Thread amacleod at redhat dot com via Gcc-bugs
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

[Bug tree-optimization/96697] Failure to optimize mod+div to 0

2021-01-02 Thread jakub at gcc dot gnu.org via Gcc-bugs
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)

[Bug tree-optimization/96697] Failure to optimize mod+div to 0

2021-01-02 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96697 Jakub Jelinek changed: What|Removed |Added CC||amacleod at redhat dot com,

[Bug tree-optimization/96697] Failure to optimize mod+div to 0

2020-08-25 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96697 Richard Biener changed: What|Removed |Added Ever confirmed|0 |1 Status|UNCONFIRMED