]> git.ipfire.org Git - thirdparty/gcc.git/commit
match.pd: Simplify (t * u) / (t * v) [PR112994]
authorJakub Jelinek <jakub@redhat.com>
Thu, 14 Dec 2023 11:06:59 +0000 (12:06 +0100)
committerJakub Jelinek <jakub@redhat.com>
Thu, 14 Dec 2023 11:06:59 +0000 (12:06 +0100)
commit2c92551405bc8616f456e5cbc696ab0292c7ff00
tree5e9678c8c6af5d2262b2385d77e520c46744117c
parent90c9403f89d3c55512ae83dd20e2023c2e4430f4
match.pd: Simplify (t * u) / (t * v) [PR112994]

On top of the previously posted patch, this simplifies say (x * 16) / (x * 4)
into 4.  Unlike the previous pattern, this is something we didn't fold
previously on GENERIC, so I think it shouldn't be all wrapped with #if
GIMPLE.  The question whether there should be fold_overflow_warning for the
TYPE_OVERFLOW_UNDEFINED case remains.

2023-12-14  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/112994
* match.pd ((t * u) / (t * v) -> (u / v)): New simplification.

* gcc.dg/tree-ssa/pr112994-2.c: New test.
gcc/match.pd
gcc/testsuite/gcc.dg/tree-ssa/pr112994-2.c [new file with mode: 0644]