More fold_negate in match.pd
authorMarc Glisse <marc.glisse@inria.fr>
Tue, 7 Nov 2017 11:04:14 +0000 (12:04 +0100)
committerMarc Glisse <glisse@gcc.gnu.org>
Tue, 7 Nov 2017 11:04:14 +0000 (11:04 +0000)
commit81bd903a6aa90326fb2a3cb451f86423f069793b
treed4d7509c7039e1f2279eb7a947b41a5781f7d6ce
parent13792cce5f6b3f01081eda5b4f0326a0aac4f368
More fold_negate in match.pd

gcc/ChangeLog:

2017-11-07  Marc Glisse  <marc.glisse@inria.fr>

* fold-const.c (negate_expr_p) [PLUS_EXPR, MINUS_EXPR]: Handle
non-scalar integral types.
* match.pd (negate_expr_p): Handle MINUS_EXPR.
(-(A-B), -(~A)): New transformations.

gcc/testsuite/ChangeLog:

2017-11-07  Marc Glisse  <marc.glisse@inria.fr>

* gcc.dg/tree-ssa/negminus.c: New test.

From-SVN: r254494
gcc/ChangeLog
gcc/fold-const.c
gcc/match.pd
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/negminus.c [new file with mode: 0644]