[PATCH 2/2] Add simplify rule for wrapped addition.
authorRobin Dapp <rdapp@linux.ibm.com>
Mon, 26 Aug 2019 10:24:44 +0000 (10:24 +0000)
committerRobin Dapp <rdapp@gcc.gnu.org>
Mon, 26 Aug 2019 10:24:44 +0000 (10:24 +0000)
commitdf7d46d925c7baca7bf9961aee900876d8aef225
tree052e129ae6ca3d130003a8d22424156f81b471c3
parente944354ec05891474b0d204c6c239c04ee7b527b
[PATCH 2/2] Add simplify rule for wrapped addition.

Add the transform (T)(A) + CST -> (T)(A + CST).  This enables vrp to
simplify sequences like

_2 = a_7 - 1;
_3 = (long unsigned int) _2;
_5 = _3 + 1

that ivopts creates.

--

gcc/ChangeLog:

2019-08-26  Robin Dapp  <rdapp@linux.ibm.com>

        * match.pd: Add (T)(A) + CST -> (T)(A + CST).

gcc/testsuite/ChangeLog:

2019-08-26  Robin Dapp  <rdapp@linux.ibm.com>

        * gcc.dg/tree-ssa/copy-headers-5.c: Do not run vrp pass.
        * gcc.dg/tree-ssa/copy-headers-7.c: Do not run vrp pass.
        * gcc.dg/tree-ssa/loop-15.c: Remove XFAIL.
        * gcc.dg/tree-ssa/pr23744.c: Change search pattern.
        * gcc.dg/wrapped-binop-simplify.c: New test.

From-SVN: r274925
gcc/ChangeLog
gcc/match.pd
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/copy-headers-5.c
gcc/testsuite/gcc.dg/tree-ssa/copy-headers-7.c
gcc/testsuite/gcc.dg/tree-ssa/loop-15.c
gcc/testsuite/gcc.dg/tree-ssa/pr23744.c
gcc/testsuite/gcc.dg/wrapped-binop-simplify.c [new file with mode: 0644]