Hello, this copies some more transformations from fold_negate_expr to match.pd. Mostly, I wanted to add (negate (pointer_diff @0 @1)), and couldn't find the corresponding transformation with minus_expr... We can see about generalizing a bit with conversions later, I wanted to have something at least. Bootstrap+regtest on powerpc64le-unknown-linux-gnu. gcc/ChangeLog: 2017-11-04 Marc Glisse * 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-04 Marc Glisse * gcc.dg/tree-ssa/negminus.c: New test. -- Marc Glisse