tree-optimization/112706 - missed simplification of condition
commitd9abaa8d58f5729925b1db735d4723a9ea825eaa
authorRichard Biener <rguenther@suse.de>
Mon, 27 Nov 2023 08:45:04 +0000 (27 09:45 +0100)
committerRichard Biener <rguenther@suse.de>
Mon, 27 Nov 2023 09:39:59 +0000 (27 10:39 +0100)
tree71b234d03d55523445b341508e2104ac564e1793
parent8e4db85eca7c6e9461b8026052f6c8545c31341c
tree-optimization/112706 - missed simplification of condition

We lack a match.pd pattern recognizing ptr + o ==/!= ptr + o'.
The following extends handling we have for integral types to
pointers.

PR tree-optimization/112706
* match.pd (ptr + o ==/!=/- ptr + o'): New patterns.

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