Hi GCC community,

This patch will add the missed pattern described in bug 102232 [1] to the 
match.pd. The testcase will test whether the multiplication and division has 
been removed from the code or not. The correctness proof for this pattern is 
here [2] in case anyone is curious.

PR tree-optimization/102232
      * match.pd (x * (1 + y / x) - y) -> (x - y % x): New optimization.
      * gcc.dg/tree-ssa/pr102232.c: testcase for this optimization.


1) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102232
2) https://alive2.llvm.org/ce/z/2VScjD

Best wishes,
Navid.

Attachment: 0001-PR-tree-optimization-102232.patch
Description: 0001-PR-tree-optimization-102232.patch

Reply via email to