PR71026: Canonicalize negates in division
authorWilco Dijkstra <wilco@gcc.gnu.org>
Tue, 7 Nov 2017 12:38:55 +0000 (12:38 +0000)
committerWilco Dijkstra <wilco@gcc.gnu.org>
Tue, 7 Nov 2017 12:38:55 +0000 (12:38 +0000)
commit6a435314929c9dc355c0f8d1c3299e1214ce580f
tree70971fd48048e5c514ac4e25841ff7ca4f9d2224
parent4349b15f97fcbb6b7cdd96bb5bff0af1eb78e653
PR71026: Canonicalize negates in division

Canonicalize x / (- y) into (-x) / y.

This moves negates out of the RHS of a division in order to
allow further simplifications and potentially more reciprocal CSEs.

2017-11-07  Wilco Dijkstra  <wdijkstr@arm.com>
    Jackson Woodruff  <jackson.woodruff@arm.com>

    gcc/
PR tree-optimization/71026
* match.pd: Canonicalize negate in division.

    testsuite/
PR 71026/tree-optimization/71026
* gcc.dg/div_neg: New test.

From-SVN: r254497
gcc/ChangeLog
gcc/match.pd
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/div_neg.c [new file with mode: 0644]