Commit 406520e2 by Marc Glisse Committed by Marc Glisse

Simplify 0 - ptr.

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

	* match.pd (0-ptr): New transformation.

From-SVN: r255139
parent f4118c87
2017-11-24 Marc Glisse <marc.glisse@inria.fr>
* match.pd (0-ptr): New transformation.
2017-11-24 Jan Hubicka <hubicka@ucw.cz> 2017-11-24 Jan Hubicka <hubicka@ucw.cz>
PR bootstrap/83015 PR bootstrap/83015
...@@ -2456,9 +2456,13 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) ...@@ -2456,9 +2456,13 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(if (INTEGRAL_TYPE_P (type)) (if (INTEGRAL_TYPE_P (type))
(mult @0 { build_int_cst (type, 2); })))) (mult @0 { build_int_cst (type, 2); }))))
/* 0 - X -> -X. */
(simplify (simplify
(minus integer_zerop @1) (minus integer_zerop @1)
(negate @1)) (negate @1))
(simplify
(pointer_diff integer_zerop @1)
(negate (convert @1)))
/* (ARG0 - ARG1) is the same as (-ARG1 + ARG0). So check whether /* (ARG0 - ARG1) is the same as (-ARG1 + ARG0). So check whether
ARG0 is zero and X + ARG0 reduces to X, since that would mean ARG0 is zero and X + ARG0 reduces to X, since that would mean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment